mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
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:
parent
2ba81538d8
commit
d7bc0530f3
@ -1,7 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import omit from 'omit.js';
|
import omit from 'omit.js';
|
||||||
import { polyfill } from 'react-lifecycles-compat';
|
|
||||||
import RcTimePicker from 'rc-time-picker/lib/TimePicker';
|
import RcTimePicker from 'rc-time-picker/lib/TimePicker';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { ClockCircle, CloseCircleFilled } from '@ant-design/icons';
|
import { ClockCircle, CloseCircleFilled } from '@ant-design/icons';
|
||||||
@ -164,10 +163,10 @@ class TimePicker extends React.Component<TimePickerProps, any> {
|
|||||||
renderInputIcon(prefixCls: string) {
|
renderInputIcon(prefixCls: string) {
|
||||||
const { suffixIcon } = this.props;
|
const { suffixIcon } = this.props;
|
||||||
const clockIcon = (suffixIcon &&
|
const clockIcon = (suffixIcon &&
|
||||||
(React.isValidElement<{ className?: string }>(suffixIcon) &&
|
React.isValidElement<{ className?: string }>(suffixIcon) &&
|
||||||
React.cloneElement(suffixIcon, {
|
React.cloneElement(suffixIcon, {
|
||||||
className: classNames(suffixIcon.props.className, `${prefixCls}-clock-icon`),
|
className: classNames(suffixIcon.props.className, `${prefixCls}-clock-icon`),
|
||||||
}))) || <ClockCircle className={`${prefixCls}-clock-icon`} />;
|
})) || <ClockCircle className={`${prefixCls}-clock-icon`} />;
|
||||||
|
|
||||||
return <span className={`${prefixCls}-icon`}>{clockIcon}</span>;
|
return <span className={`${prefixCls}-icon`}>{clockIcon}</span>;
|
||||||
}
|
}
|
||||||
@ -242,6 +241,4 @@ class TimePicker extends React.Component<TimePickerProps, any> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
polyfill(TimePicker);
|
|
||||||
|
|
||||||
export default TimePicker;
|
export default TimePicker;
|
||||||
|
@ -183,7 +183,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-icon,
|
&-icon,
|
||||||
&-clear {
|
&-clear.@{iconfont-css-prefix} {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: @control-padding-horizontal - 1px;
|
right: @control-padding-horizontal - 1px;
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
"rc-switch": "~1.9.0",
|
"rc-switch": "~1.9.0",
|
||||||
"rc-table": "~6.9.4",
|
"rc-table": "~6.9.4",
|
||||||
"rc-tabs": "~9.6.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-tooltip": "~3.7.3",
|
||||||
"rc-tree": "~3.0.0-alpha.37",
|
"rc-tree": "~3.0.0-alpha.37",
|
||||||
"rc-tree-select": "~3.0.0-alpha.5",
|
"rc-tree-select": "~3.0.0-alpha.5",
|
||||||
|
Loading…
Reference in New Issue
Block a user