Skip to content

Commit

Permalink
refactor: Upgrade rc-time-picker for new rc-trigger (#19698)
Browse files Browse the repository at this point in the history
* 🆙 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
  • Loading branch information
afc163 authored and zombieJ committed Nov 15, 2019
1 parent 2ba8153 commit d7bc053
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions components/time-picker/index.tsx
@@ -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';
Expand Down Expand Up @@ -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>;
}
Expand Down Expand Up @@ -242,6 +241,4 @@ class TimePicker extends React.Component<TimePickerProps, any> {
}
}

polyfill(TimePicker);

export default TimePicker;
2 changes: 1 addition & 1 deletion components/time-picker/style/index.less
Expand Up @@ -183,7 +183,7 @@
}

&-icon,
&-clear {
&-clear.@{iconfont-css-prefix} {
position: absolute;
top: 50%;
right: @control-padding-horizontal - 1px;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down

0 comments on commit d7bc053

Please sign in to comment.