diff --git a/components/date-picker/Calendar.tsx b/components/date-picker/Calendar.tsx deleted file mode 100644 index d134fe41e5..0000000000 --- a/components/date-picker/Calendar.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react'; -import CalendarLocale from 'rc-calendar/lib/locale/zh_CN'; -import RcCalendar from 'rc-calendar'; -import warning from 'warning'; - -export default class Calendar extends React.Component { - static defaultProps = { - locale: CalendarLocale, - prefixCls: 'ant-calendar', - }; - - render() { - warning(false, 'DatePicker.Calendar is deprecated, use Calendar instead.'); - return ; - } -} diff --git a/components/date-picker/index.tsx b/components/date-picker/index.tsx index ac49ddaac0..3e4c817091 100755 --- a/components/date-picker/index.tsx +++ b/components/date-picker/index.tsx @@ -6,7 +6,6 @@ import createPicker from './createPicker'; import wrapPicker from './wrapPicker'; import RangePicker from './RangePicker'; import WeekPicker from './WeekPicker'; -import Calendar from './Calendar'; import { TimePickerProps } from '../time-picker'; export interface PickerProps { @@ -40,7 +39,6 @@ export interface DatePickerProps extends PickerProps, SinglePickerProps { showTime?: TimePickerProps | boolean; showToday?: boolean; open?: boolean; - toggleOpen?: (e: {open: boolean}) => void; disabledTime?: (current: moment.Moment) => { disabledHours?: () => number[], disabledMinutes?: () => number[], @@ -84,7 +82,6 @@ export interface WeexPickerProps extends PickerProps, SinglePickerProps { Object.assign(DatePicker, { RangePicker: wrapPicker(RangePicker), - Calendar, MonthPicker, WeekPicker: wrapPicker(WeekPicker, 'YYYY-Wo'), }); diff --git a/components/date-picker/wrapPicker.tsx b/components/date-picker/wrapPicker.tsx index f6aca413f9..241bc71632 100644 --- a/components/date-picker/wrapPicker.tsx +++ b/components/date-picker/wrapPicker.tsx @@ -3,7 +3,7 @@ import TimePickerPanel from 'rc-time-picker/lib/Panel'; import classNames from 'classnames'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import { generateShowHourMinuteSecond } from '../time-picker'; -import warning from '../_util/warning'; + declare const require: Function; function getColumns({ showHour, showMinute, showSecond, use12Hours }: any) { @@ -41,17 +41,8 @@ export default function wrapPicker(Picker: React.ComponentClass, defaultFor }; handleOpenChange = (open: boolean) => { - const { onOpenChange, toggleOpen } = this.props; + const { onOpenChange } = this.props; onOpenChange(open); - - if (toggleOpen) { - warning( - false, - '`toggleOpen` is deprecated and will be removed in the future, ' + - 'please use `onOpenChange` instead, see: https://u.ant.design/date-picker-on-open-change', - ); - toggleOpen({ open }); - } } getDefaultLocale() { diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 3373ae73f7..025c46acdf 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -18,9 +18,6 @@ export interface FormCreateOption { export interface FormProps { layout?: 'horizontal' | 'inline' | 'vertical'; - horizontal?: boolean; - inline?: boolean; - vertical?: boolean; form?: WrappedFormUtils; onSubmit?: React.FormEventHandler; style?: React.CSSProperties; @@ -170,26 +167,20 @@ export default class Form extends React.Component { } getChildContext() { - const { layout, vertical } = this.props; + const { layout } = this.props; return { - vertical: layout === 'vertical' || vertical, + vertical: layout === 'vertical', }; } render() { const { prefixCls, hideRequiredMark, className = '', layout, - // @deprecated - inline, horizontal, vertical, } = this.props; - warning( - !inline && !horizontal && !vertical, - '`Form[inline|horizontal|vertical]` is deprecated, please use `Form[layout]` instead.', - ); const formClassName = classNames(prefixCls, { - [`${prefixCls}-horizontal`]: (!inline && !vertical && layout === 'horizontal') || horizontal, - [`${prefixCls}-vertical`]: layout === 'vertical' || vertical, - [`${prefixCls}-inline`]: layout === 'inline' || inline, + [`${prefixCls}-horizontal`]: layout === 'horizontal', + [`${prefixCls}-vertical`]: layout === 'vertical', + [`${prefixCls}-inline`]: layout === 'inline', [`${prefixCls}-hide-required-mark`]: hideRequiredMark, }, className); @@ -197,9 +188,6 @@ export default class Form extends React.Component { 'prefixCls', 'className', 'layout', - 'inline', - 'horizontal', - 'vertical', 'form', 'hideRequiredMark', ]); diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index b6637699e8..6f04c22a90 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -9,7 +9,7 @@ Form is used to collect, validate, and submit the user input, usually contains v ## Form -You can align the controls of a `form` using one of the following attributes: +You can align the controls of a `form` using the `layout` prop: - `horizontal`:to horizontally align the `label`s and controls of the fields. (Default) - `vertical`:to vertically align the `label`s and controls of the fields. @@ -38,10 +38,7 @@ A form field is defined using ``. | -------- | ----------- | ---- | ------------- | | form | Decorated by `Form.create()` will be automatically set `this.props.form` property, so just pass to form, you don't need to set it by yourself after 1.7.0. | object | n/a | | hideRequiredMark | Hide required mark of all form items | Boolean | false | -| horizontal | Use horizontal layout(Deprecated after 2.8) | boolean | true | -| inline | Use inline alignment(Deprecated after 2.8) | boolean | false | | layout | Define form layout(Support after 2.8) | 'horizontal'\|'vertical'\|'inline' | 'horizontal' | -| vertical | Use vertical layout(Deprecated after 2.8) | boolean | false | | onSubmit | Defines a function will be called if form data validation is successful. | Function(e:Event) | | ### Form.create(options) diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index dc01710e6d..954d85a01a 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -40,10 +40,7 @@ title: Form | --- | --- | --- | --- | | form | 经 `Form.create()` 包装过的组件会自带 `this.props.form` 属性,直接传给 Form 即可。1.7.0 之后无需设置 | object | 无 | | hideRequiredMark | 隐藏所有表单项的必选标记 | Boolean | false | -| horizontal | 水平排列布局(2.8 之后废弃) | boolean | true | -| inline | 行内排列布局(2.8 之后废弃) | boolean | false | | layout | 表单布局(2.8 之后支持) | 'horizontal'\|'vertical'\|'inline' | 'horizontal' | -| vertical | 垂直排列布局(2.8 之后废弃) | boolean | false | | onSubmit | 数据验证成功后回调事件 | Function(e:Event) | | ### Form.create(options) diff --git a/components/input/Input.tsx b/components/input/Input.tsx index a1aaef41c8..4dea064cf5 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -222,9 +222,6 @@ export default class Input extends React.Component { } render() { - if (this.props.type === 'textarea') { - return