merge master

This commit is contained in:
zombiej
2020-03-29 14:40:29 +08:00
15 changed files with 55 additions and 17 deletions

View File

@@ -2,7 +2,9 @@ const libDir = process.env.LIB_DIR;
const transformIgnorePatterns = [
'/dist/',
'node_modules/[^/]+?/(?!(es|node_modules)/)', // Ignore modules without es dir
// Ignore modules without es dir.
// Update: @babel/runtime should also be transformed
'node_modules/(?!.*@babel)[^/]+?/(?!(es|node_modules)/)',
];
module.exports = {

View File

@@ -120,7 +120,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
loading: false,
ghost: false,
block: false,
htmlType: 'button',
htmlType: 'button' as ButtonProps['htmlType'],
};
private delayTimeout: number;

View File

@@ -40,7 +40,7 @@ export default class Collapse extends React.Component<CollapseProps, any> {
static defaultProps = {
bordered: true,
expandIconPosition: 'left',
expandIconPosition: 'left' as CollapseProps['expandIconPosition'],
};
renderExpandIcon = (panelProps: PanelProps = {}, prefixCls: string) => {

View File

@@ -6441,6 +6441,7 @@ exports[`ConfigProvider components Drawer configProvider 1`] = `
<button
aria-label="Close"
class="config-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -6501,6 +6502,7 @@ exports[`ConfigProvider components Drawer normal 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -6561,6 +6563,7 @@ exports[`ConfigProvider components Drawer prefixCls 1`] = `
<button
aria-label="Close"
class="prefix-Drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"

View File

@@ -28,6 +28,7 @@ exports[`Drawer className is test_drawer 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -124,6 +125,7 @@ exports[`Drawer destroyOnClose is true 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -186,6 +188,7 @@ exports[`Drawer have a footer 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -258,6 +261,7 @@ exports[`Drawer have a title 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -320,6 +324,7 @@ exports[`Drawer render correctly 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -382,6 +387,7 @@ exports[`Drawer render top drawer 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"
@@ -449,6 +455,7 @@ exports[`Drawer style/drawerStyle/headerStyle/bodyStyle should work 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar:0px"
>
<span
aria-label="close"

View File

@@ -36,6 +36,7 @@ exports[`Drawer render correctly 1`] = `
<button
aria-label="Close"
class="ant-drawer-close"
style="--scroll-bar: 0px;"
>
<span
aria-label="close"

View File

@@ -1,5 +1,6 @@
import * as React from 'react';
import RcDrawer from 'rc-drawer';
import getScrollBarSize from 'rc-util/lib/getScrollBarSize';
import CloseOutlined from '@ant-design/icons/CloseOutlined';
import classNames from 'classnames';
import omit from 'omit.js';
@@ -179,7 +180,16 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
return (
closable && (
// eslint-disable-next-line react/button-has-type
<button onClick={onClose} aria-label="Close" className={`${prefixCls}-close`}>
<button
onClick={onClose}
aria-label="Close"
className={`${prefixCls}-close`}
style={
{
'--scroll-bar': `${getScrollBarSize()}px`,
} as any
}
>
<CloseOutlined />
</button>
)

View File

@@ -3,7 +3,11 @@
@drawer-prefix-cls: ~'@{ant-prefix}-drawer';
@picker-prefix-cls: ~'@{ant-prefix}-picker';
.@{drawer-prefix-cls} {
@drawer-header-close-padding: ceil((@drawer-header-close-size - @font-size-lg) / 2);
position: fixed;
z-index: @zindex-modal;
width: 0%;
@@ -157,14 +161,12 @@
right: 0;
z-index: @zindex-popup-close;
display: block;
width: @drawer-header-close-size;
height: @drawer-header-close-size;
padding: 0;
padding: @drawer-header-close-padding;
color: @text-color-secondary;
font-weight: 700;
font-size: @font-size-lg;
font-style: normal;
line-height: @drawer-header-close-size;
line-height: 1;
text-align: center;
text-transform: none;
text-decoration: none;
@@ -180,6 +182,11 @@
color: @icon-color-hover;
text-decoration: none;
}
.@{drawer-prefix-cls}-header-no-title & {
margin-right: var(--scroll-bar);
padding-right: calc(@drawer-header-close-padding - var(--scroll-bar));
}
}
&-header {

View File

@@ -5,7 +5,11 @@ title: Icon
toc: false
---
Semantic vector graphics.
Semantic vector graphics. Before use icons, you need to install `@ant-design/icons` package:
```bash
npm install --save @ant-design/icons
```
## List of icons

View File

@@ -6,7 +6,11 @@ title: Icon
toc: false
---
语义化的矢量图形。
语义化的矢量图形。使用图标组件,你需要安装 `@ant-design/icons` 图标组件包:
```bash
npm install --save @ant-design/icons
```
## 设计师专属

View File

@@ -43,14 +43,14 @@ export interface ProgressProps {
export default class Progress extends React.Component<ProgressProps> {
static defaultProps = {
type: 'line',
type: 'line' as ProgressProps['type'],
percent: 0,
showInfo: true,
// null for different theme definition
trailColor: null,
size: 'default',
size: 'default' as ProgressProps['size'],
gapDegree: undefined,
strokeLinecap: 'round',
strokeLinecap: 'round' as ProgressProps['strokeLinecap'],
};
getPercentNumber() {

View File

@@ -12,7 +12,7 @@ import { ConfigConsumerProps, ConfigConsumer } from '../config-provider';
export default class TabBar extends React.Component<TabsProps> {
static defaultProps = {
animated: true,
type: 'line',
type: 'line' as TabsProps['type'],
};
renderTabBar = ({ direction }: ConfigConsumerProps) => {

View File

@@ -21,7 +21,7 @@ export default class Timeline extends React.Component<TimelineProps, any> {
static defaultProps = {
reverse: false,
mode: '',
mode: '' as TimelineProps['mode'],
};
renderTimeline = ({ getPrefixCls, direction }: ConfigConsumerProps) => {

View File

@@ -39,7 +39,7 @@ function getTreeData({ treeData, children }: DirectoryTreeProps) {
class DirectoryTree extends React.Component<DirectoryTreeProps, DirectoryTreeState> {
static defaultProps = {
showIcon: true,
expandAction: 'click',
expandAction: 'click' as DirectoryTreeProps['expandAction'],
};
static getDerivedStateFromProps(nextProps: DirectoryTreeProps) {

View File

@@ -142,7 +142,7 @@
},
"devDependencies": {
"@ant-design/bisheng-plugin": "^2.3.0",
"@ant-design/colors": "^4.0.0-alpha.1",
"@ant-design/colors": "^4.0.0",
"@ant-design/hitu": "^0.0.0-alpha.13",
"@ant-design/tools": "^8.0.4",
"@packtracker/webpack-plugin": "^2.0.1",