refactor: Upgrade rc-time-picker for new rc-trigger (#19698)

* 🆙 upgrade rc-time-picker to 4.0

* 💄 fix time picker clear icon color

* 🆙 upgrade rc-time-picker to 4.0

* 💄 fix time picker clear icon color

* refactor: remove react-lifecycle-compat polyfill

* 🆙 upgrade rc-time-picker to 4.0.0-alpha.1

*  fix test case

* 🆙 upgrade rc-time-picker to 4.0.0-alpha.2

* chore: revert es to lib
This commit is contained in:
偏右 2019-11-15 14:28:13 +08:00 committed by 二货机器人
parent 2ba81538d8
commit d7bc0530f3
3 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,6 @@
import * as React from 'react';
import * as moment from 'moment';
import omit from 'omit.js';
import { polyfill } from 'react-lifecycles-compat';
import RcTimePicker from 'rc-time-picker/lib/TimePicker';
import classNames from 'classnames';
import { ClockCircle, CloseCircleFilled } from '@ant-design/icons';
@ -164,10 +163,10 @@ class TimePicker extends React.Component<TimePickerProps, any> {
renderInputIcon(prefixCls: string) {
const { suffixIcon } = this.props;
const clockIcon = (suffixIcon &&
(React.isValidElement<{ className?: string }>(suffixIcon) &&
React.cloneElement(suffixIcon, {
className: classNames(suffixIcon.props.className, `${prefixCls}-clock-icon`),
}))) || <ClockCircle className={`${prefixCls}-clock-icon`} />;
React.isValidElement<{ className?: string }>(suffixIcon) &&
React.cloneElement(suffixIcon, {
className: classNames(suffixIcon.props.className, `${prefixCls}-clock-icon`),
})) || <ClockCircle className={`${prefixCls}-clock-icon`} />;
return <span className={`${prefixCls}-icon`}>{clockIcon}</span>;
}
@ -242,6 +241,4 @@ class TimePicker extends React.Component<TimePickerProps, any> {
}
}
polyfill(TimePicker);
export default TimePicker;

View File

@ -183,7 +183,7 @@
}
&-icon,
&-clear {
&-clear.@{iconfont-css-prefix} {
position: absolute;
top: 50%;
right: @control-padding-horizontal - 1px;

View File

@ -129,7 +129,7 @@
"rc-switch": "~1.9.0",
"rc-table": "~6.9.4",
"rc-tabs": "~9.6.4",
"rc-time-picker": "~3.7.1",
"rc-time-picker": "~4.0.0-alpha.2",
"rc-tooltip": "~3.7.3",
"rc-tree": "~3.0.0-alpha.37",
"rc-tree-select": "~3.0.0-alpha.5",