Skip to content

Commit 9543934

Browse files
[Core] Remove the deprecated code for v0.16.0
1 parent 66d7f15 commit 9543934

21 files changed

Lines changed: 21 additions & 480 deletions

src/AutoComplete/AutoComplete.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import MenuItem from '../MenuItem';
77
import Divider from '../Divider';
88
import Popover from '../Popover/Popover';
99
import propTypes from '../utils/propTypes';
10-
import warning from 'warning';
11-
import deprecated from '../utils/deprecatedPropType';
1210

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

177171
static defaultProps = {
@@ -246,21 +240,6 @@ class AutoComplete extends Component {
246240
}
247241
};
248242

249-
setValue(textValue) {
250-
warning(false, `setValue() is deprecated, use the searchText property.
251-
It will be removed with v0.16.0.`);
252-
253-
this.setState({
254-
searchText: textValue,
255-
});
256-
}
257-
258-
getValue() {
259-
warning(false, 'getValue() is deprecated. It will be removed with v0.16.0.');
260-
261-
return this.state.searchText;
262-
}
263-
264243
handleMouseDown = (event) => {
265244
// Keep the TextField focused
266245
event.preventDefault();
@@ -355,7 +334,7 @@ class AutoComplete extends Component {
355334
};
356335

357336
handleFocus = (event) => {
358-
if (!this.state.open && (this.props.triggerUpdateOnFocus || this.props.openOnFocus)) {
337+
if (!this.state.open && this.props.openOnFocus) {
359338
this.setState({
360339
open: true,
361340
anchorEl: ReactDOM.findDOMNode(this.refs.searchTextField),
@@ -400,7 +379,6 @@ class AutoComplete extends Component {
400379
menuProps,
401380
listStyle,
402381
targetOrigin,
403-
triggerUpdateOnFocus, // eslint-disable-line no-unused-vars
404382
onNewRequest, // eslint-disable-line no-unused-vars
405383
onUpdateInput, // eslint-disable-line no-unused-vars
406384
openOnFocus, // eslint-disable-line no-unused-vars

src/Checkbox/Checkbox.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import EnhancedSwitch from '../internal/EnhancedSwitch';
33
import transitions from '../styles/transitions';
44
import CheckboxOutline from '../svg-icons/toggle/check-box-outline-blank';
55
import CheckboxChecked from '../svg-icons/toggle/check-box';
6-
import deprecated from '../utils/deprecatedPropType';
76

87
function getStyles(props, context) {
98
const {checkbox} = context.muiTheme;
@@ -104,12 +103,6 @@ class Checkbox extends Component {
104103
* Override the inline-styles of the root element.
105104
*/
106105
style: PropTypes.object,
107-
/**
108-
* The SvgIcon to use for the unchecked state.
109-
* This is useful to create icon toggles.
110-
*/
111-
unCheckedIcon: deprecated(PropTypes.element,
112-
'Use uncheckedIcon instead. It will be removed with v0.16.0.'),
113106
/**
114107
* The SvgIcon to use for the unchecked state.
115108
* This is useful to create icon toggles.
@@ -178,7 +171,6 @@ class Checkbox extends Component {
178171
onCheck, // eslint-disable-line no-unused-vars
179172
checkedIcon,
180173
uncheckedIcon,
181-
unCheckedIcon,
182174
...other,
183175
} = this.props;
184176
const styles = getStyles(this.props, this.context);
@@ -201,8 +193,8 @@ class Checkbox extends Component {
201193
style: checkStyles,
202194
});
203195

204-
const unCheckedElement = (unCheckedIcon || uncheckedIcon) ? React.cloneElement((unCheckedIcon || uncheckedIcon), {
205-
style: Object.assign(boxStyles, (unCheckedIcon || uncheckedIcon).props.style),
196+
const unCheckedElement = uncheckedIcon ? React.cloneElement(uncheckedIcon, {
197+
style: Object.assign(boxStyles, uncheckedIcon.props.style),
206198
}) : React.createElement(CheckboxOutline, {
207199
style: boxStyles,
208200
});

src/DatePicker/Calendar.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class Calendar extends Component {
4343
onTouchTapOk: PropTypes.func,
4444
open: PropTypes.bool,
4545
shouldDisableDate: PropTypes.func,
46-
wordings: PropTypes.object,
4746
};
4847

4948
static defaultProps = {
@@ -299,7 +298,6 @@ class Calendar extends Component {
299298
okLabel,
300299
onTouchTapCancel, // eslint-disable-line no-unused-vars
301300
onTouchTapOk, // eslint-disable-line no-unused-vars
302-
wordings,
303301
} = this.props;
304302

305303
return (
@@ -364,7 +362,6 @@ class Calendar extends Component {
364362
okLabel={okLabel}
365363
onTouchTapCancel={onTouchTapCancel}
366364
onTouchTapOk={onTouchTapOk}
367-
wordings={wordings}
368365
/>
369366
}
370367
</div>

src/DatePicker/CalendarActionButtons.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ class CalendarActionButton extends Component {
88
okLabel: PropTypes.node,
99
onTouchTapCancel: PropTypes.func,
1010
onTouchTapOk: PropTypes.func,
11-
wordings: PropTypes.object,
1211
};
1312

1413
render() {
15-
const {cancelLabel, okLabel, wordings} = this.props;
14+
const {cancelLabel, okLabel} = this.props;
1615

1716
const styles = {
1817
root: {
@@ -35,15 +34,15 @@ class CalendarActionButton extends Component {
3534
return (
3635
<div style={styles.root} >
3736
<FlatButton
38-
label={wordings ? wordings.cancel : cancelLabel}
37+
label={cancelLabel}
3938
onTouchTap={this.props.onTouchTapCancel}
4039
primary={true}
4140
style={styles.flatButtons}
4241
/>
4342
{!this.props.autoOk &&
4443
<FlatButton
4544
disabled={this.refs.calendar !== undefined && this.refs.calendar.isSelectedDateDisabled()}
46-
label={wordings ? wordings.ok : okLabel}
45+
label={okLabel}
4746
onTouchTap={this.props.onTouchTapOk}
4847
primary={true}
4948
style={styles.flatButtons}

src/DatePicker/DatePicker.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, {Component, PropTypes} from 'react';
22
import {dateTimeFormat, formatIso, isEqualDate} from './dateUtils';
33
import DatePickerDialog from './DatePickerDialog';
44
import TextField from '../TextField';
5-
import deprecated from '../utils/deprecatedPropType';
65

76
class DatePicker extends Component {
87
static propTypes = {
@@ -134,11 +133,6 @@ class DatePicker extends Component {
134133
* Sets the date for the Date Picker programmatically.
135134
*/
136135
value: PropTypes.object,
137-
/**
138-
* Wordings used inside the button of the dialog.
139-
*/
140-
wordings: deprecated(PropTypes.object, `Instead, use \`cancelLabel\` and \`okLabel\`.
141-
It will be removed with v0.16.0.`),
142136
};
143137

144138
static defaultProps = {
@@ -283,7 +277,6 @@ class DatePicker extends Component {
283277
shouldDisableDate,
284278
style,
285279
textFieldStyle,
286-
wordings,
287280
...other,
288281
} = this.props;
289282

@@ -319,7 +312,6 @@ class DatePicker extends Component {
319312
onDismiss={onDismiss}
320313
ref="dialogWindow"
321314
shouldDisableDate={shouldDisableDate}
322-
wordings={wordings}
323315
/>
324316
</div>
325317
);

src/DatePicker/DatePickerDialog.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class DatePickerDialog extends Component {
2929
open: PropTypes.bool,
3030
shouldDisableDate: PropTypes.func,
3131
style: PropTypes.object,
32-
wordings: PropTypes.object,
3332
};
3433

3534
static defaultProps = {
@@ -120,7 +119,6 @@ class DatePickerDialog extends Component {
120119
onShow, // eslint-disable-line no-unused-vars
121120
shouldDisableDate,
122121
style, // eslint-disable-line no-unused-vars
123-
wordings,
124122
animation,
125123
...other,
126124
} = this.props;
@@ -175,7 +173,6 @@ class DatePickerDialog extends Component {
175173
onTouchTapOk={this.handleTouchTapOk}
176174
okLabel={okLabel}
177175
shouldDisableDate={shouldDisableDate}
178-
wordings={wordings}
179176
/>
180177
</Container>
181178
</div>

src/List/List.js

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import React, {Component, PropTypes, Children, isValidElement} from 'react';
2-
import propTypes from '../utils/propTypes';
32
import Subheader from '../Subheader';
4-
import deprecated from '../utils/deprecatedPropType';
5-
import warning from 'warning';
63

74
class List extends Component {
85
static propTypes = {
@@ -11,31 +8,10 @@ class List extends Component {
118
* be part of the list.
129
*/
1310
children: PropTypes.node,
14-
/**
15-
* If true, the subheader will be indented by 72px.
16-
*/
17-
insetSubheader: deprecated(PropTypes.bool,
18-
'Refer to the `subheader` property. It will be removed with v0.16.0.'),
1911
/**
2012
* Override the inline-styles of the root element.
2113
*/
2214
style: PropTypes.object,
23-
/**
24-
* The subheader string that will be displayed at the top of the list.
25-
*/
26-
subheader: deprecated(PropTypes.node,
27-
'Instead, nest the `Subheader` component directly inside the `List`. It will be removed with v0.16.0.'),
28-
/**
29-
* Override the inline-styles of the subheader element.
30-
*/
31-
subheaderStyle: deprecated(PropTypes.object,
32-
'Refer to the `subheader` property. It will be removed with v0.16.0.'),
33-
/**
34-
* @ignore
35-
* ** Breaking change ** List no longer supports `zDepth`. Instead, wrap it in `Paper`
36-
* or another component that provides zDepth.
37-
*/
38-
zDepth: propTypes.zDepth,
3915
};
4016

4117
static contextTypes = {
@@ -45,28 +21,17 @@ class List extends Component {
4521
render() {
4622
const {
4723
children,
48-
insetSubheader = false,
4924
style,
50-
subheader,
51-
subheaderStyle,
52-
zDepth,
5325
...other,
5426
} = this.props;
5527

5628
const {prepareStyles} = this.context.muiTheme;
5729

58-
warning((typeof zDepth === 'undefined'), 'List no longer supports `zDepth`. Instead, wrap it in `Paper` ' +
59-
'or another component that provides zDepth. It will be removed with v0.16.0.');
60-
6130
let hasSubheader = false;
6231

63-
if (subheader) {
32+
const firstChild = Children.toArray(children)[0];
33+
if (isValidElement(firstChild) && firstChild.type === Subheader) {
6434
hasSubheader = true;
65-
} else {
66-
const firstChild = Children.toArray(children)[0];
67-
if (isValidElement(firstChild) && firstChild.type === Subheader) {
68-
hasSubheader = true;
69-
}
7035
}
7136

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

8045
return (
8146
<div {...other} style={prepareStyles(Object.assign(styles.root, style))}>
82-
{subheader && (
83-
<Subheader inset={insetSubheader} style={subheaderStyle}>
84-
{subheader}
85-
</Subheader>
86-
)}
8747
{children}
8848
</div>
8949
);

src/List/MakeSelectable.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, {Component, PropTypes} from 'react';
22
import {fade} from '../utils/colorManipulator';
3-
import deprecated from '../utils/deprecatedPropType';
43

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

1913
static contextTypes = {
2014
muiTheme: PropTypes.object.isRequired,
2115
};
2216

23-
getValueLink(props) {
24-
return props.valueLink || {
25-
value: props.value,
26-
requestChange: props.onChange,
27-
};
28-
}
29-
3017
extendChild(child, styles, selectedItemStyle) {
3118
if (child && child.type && child.type.muiName === 'ListItem') {
3219
const selected = this.isChildSelected(child, this.props);
@@ -71,15 +58,14 @@ export const MakeSelectable = (Component) => {
7158
};
7259

7360
isChildSelected(child, props) {
74-
return this.getValueLink(props).value === child.props.value;
61+
return props.value === child.props.value;
7562
}
7663

7764
handleItemTouchTap = (event, item) => {
78-
const valueLink = this.getValueLink(this.props);
7965
const itemValue = item.props.value;
8066

81-
if (itemValue !== valueLink.value) {
82-
valueLink.requestChange(event, itemValue);
67+
if (itemValue !== this.props.value) {
68+
this.props.onChange(event, itemValue);
8369
}
8470
};
8571

0 commit comments

Comments
 (0)