Merge branch 'master' into eugene-matvejev-patch-4

This commit is contained in:
Eugene Matvejev 2020-11-24 12:22:31 +00:00 committed by GitHub
commit b2fa4280f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 27 deletions

View File

@ -43,7 +43,7 @@ interface CollapseInterface extends React.FC<CollapseProps> {
const Collapse: CollapseInterface = props => { const Collapse: CollapseInterface = props => {
const { getPrefixCls, direction } = React.useContext(ConfigContext); const { getPrefixCls, direction } = React.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className = '', bordered, ghost } = props; const { prefixCls: customizePrefixCls, className = '', bordered = true, ghost } = props;
const prefixCls = getPrefixCls('collapse', customizePrefixCls); const prefixCls = getPrefixCls('collapse', customizePrefixCls);
const getIconPosition = () => { const getIconPosition = () => {
@ -83,6 +83,7 @@ const Collapse: CollapseInterface = props => {
<RcCollapse <RcCollapse
openAnimation={openAnimation} openAnimation={openAnimation}
{...props} {...props}
bordered={bordered}
expandIcon={renderExpandIcon} expandIcon={renderExpandIcon}
prefixCls={prefixCls} prefixCls={prefixCls}
className={collapseClassName} className={collapseClassName}
@ -92,8 +93,4 @@ const Collapse: CollapseInterface = props => {
Collapse.Panel = CollapsePanel; Collapse.Panel = CollapsePanel;
Collapse.defaultProps = {
bordered: true,
};
export default Collapse; export default Collapse;

View File

@ -1,6 +1,5 @@
import * as React from 'react'; import * as React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import omit from 'omit.js';
import { ConfigContext } from '../config-provider'; import { ConfigContext } from '../config-provider';
export interface TimelineItemProps { export interface TimelineItemProps {
@ -20,18 +19,18 @@ export interface TimeLineItemProps extends TimelineItemProps {
__deprecated_do_not_use_it__?: any; // eslint-disable-line camelcase __deprecated_do_not_use_it__?: any; // eslint-disable-line camelcase
} }
const TimelineItem: React.FC<TimelineItemProps> = props => { const TimelineItem: React.FC<TimelineItemProps> = ({
prefixCls: customizePrefixCls,
className,
color = 'blue',
dot,
pending = false,
position, /** dead, but do not pass in <li {...omit()} */
label,
children,
...restProps
}) => {
const { getPrefixCls } = React.useContext(ConfigContext); const { getPrefixCls } = React.useContext(ConfigContext);
const {
prefixCls: customizePrefixCls,
className,
color,
children,
pending,
dot,
label,
...restProps
} = props;
const prefixCls = getPrefixCls('timeline', customizePrefixCls); const prefixCls = getPrefixCls('timeline', customizePrefixCls);
const itemClassName = classNames( const itemClassName = classNames(
@ -49,7 +48,7 @@ const TimelineItem: React.FC<TimelineItemProps> = props => {
}); });
return ( return (
<li {...omit(restProps, ['position'])} className={itemClassName}> <li {...restProps} className={itemClassName}>
{label && <div className={`${prefixCls}-item-label`}>{label}</div>} {label && <div className={`${prefixCls}-item-label`}>{label}</div>}
<div className={`${prefixCls}-item-tail`} /> <div className={`${prefixCls}-item-tail`} />
<div <div
@ -63,10 +62,4 @@ const TimelineItem: React.FC<TimelineItemProps> = props => {
); );
}; };
TimelineItem.defaultProps = {
color: 'blue',
pending: false,
position: '',
};
export default TimelineItem; export default TimelineItem;

View File

@ -213,7 +213,8 @@ class Base extends React.Component<InternalBlockProps, BaseState> {
}; };
// ================ Copy ================ // ================ Copy ================
onCopyClick = () => { onCopyClick = (e: React.MouseEvent<HTMLDivElement>) => {
e.preventDefault();
const { children, copyable } = this.props; const { children, copyable } = this.props;
const copyConfig: CopyConfig = { const copyConfig: CopyConfig = {
...(typeof copyable === 'object' ? copyable : null), ...(typeof copyable === 'object' ? copyable : null),

View File

@ -25,7 +25,7 @@ title: Third-Party Libraries
| Top Progress Bar | [nprogress](https://github.com/rstacruz/nprogress) | | Top Progress Bar | [nprogress](https://github.com/rstacruz/nprogress) |
| i18n | [react-intl](https://github.com/yahoo/react-intl) | | i18n | [react-intl](https://github.com/yahoo/react-intl) |
| Code highlight | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter) | | Code highlight | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter) |
| Markdown renderer | [react-markdown](http://rexxars.github.io/react-markdown/) | | Markdown renderer | [react-markdown](https://remarkjs.github.io/react-markdown/) |
| Infinite Scroll | [react-virtualized](https://github.com/bvaughn/react-virtualized) [antd-table-infinity](https://github.com/Leonard-Li777/antd-table-infinity) | | Infinite Scroll | [react-virtualized](https://github.com/bvaughn/react-virtualized) [antd-table-infinity](https://github.com/Leonard-Li777/antd-table-infinity) |
| Map | [react-google-maps](https://github.com/tomchentw/react-google-maps) [google-map-react](https://github.com/istarkov/google-map-react) [react-amap](https://github.com/ElemeFE/react-amap) | | Map | [react-google-maps](https://github.com/tomchentw/react-google-maps) [google-map-react](https://github.com/istarkov/google-map-react) [react-amap](https://github.com/ElemeFE/react-amap) |
| Video | [react-player](https://github.com/CookPete/react-player) [video-react](https://github.com/video-react/video-react) [video.js](http://docs.videojs.com/tutorial-react.html) | | Video | [react-player](https://github.com/CookPete/react-player) [video-react](https://github.com/video-react/video-react) [video.js](http://docs.videojs.com/tutorial-react.html) |

View File

@ -25,7 +25,7 @@ title: 社区精选组件
| 顶部进度条 | [nprogress](https://github.com/rstacruz/nprogress) | | 顶部进度条 | [nprogress](https://github.com/rstacruz/nprogress) |
| 应用国际化 | [react-intl](https://github.com/yahoo/react-intl) | | 应用国际化 | [react-intl](https://github.com/yahoo/react-intl) |
| 代码高亮 | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter) | | 代码高亮 | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter) |
| Markdown 渲染 | [react-markdown](http://rexxars.github.io/react-markdown/) | | Markdown 渲染 | [react-markdown](https://remarkjs.github.io/react-markdown/) |
| 无限滚动 | [react-virtualized](https://github.com/bvaughn/react-virtualized) [antd-table-infinity](https://github.com/Leonard-Li777/antd-table-infinity) | | 无限滚动 | [react-virtualized](https://github.com/bvaughn/react-virtualized) [antd-table-infinity](https://github.com/Leonard-Li777/antd-table-infinity) |
| 地图 | [react-google-maps](https://github.com/tomchentw/react-google-maps) [google-map-react](https://github.com/istarkov/google-map-react) [react-amap 高德](https://github.com/ElemeFE/react-amap) | | 地图 | [react-google-maps](https://github.com/tomchentw/react-google-maps) [google-map-react](https://github.com/istarkov/google-map-react) [react-amap 高德](https://github.com/ElemeFE/react-amap) |
| 视频播放 | [react-player](https://github.com/CookPete/react-player) [video-react](https://github.com/video-react/video-react) [video.js](http://docs.videojs.com/tutorial-react.html) | | 视频播放 | [react-player](https://github.com/CookPete/react-player) [video-react](https://github.com/video-react/video-react) [video.js](http://docs.videojs.com/tutorial-react.html) |