From 7cea7dddc6eac251a5acfa054756cfb72f849f2d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 28 Mar 2020 19:10:17 +0800 Subject: [PATCH 1/5] :up: @ant-design/colors --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e523e366c9..5c8e605ce5 100644 --- a/package.json +++ b/package.json @@ -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", From 2cb516b5b7f1705a13631386d6b297e0caec8ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Sat, 28 Mar 2020 12:29:02 +0100 Subject: [PATCH 2/5] fix: narrow down types of string literals in a few defaultProps declarations (#22686) --- components/button/button.tsx | 2 +- components/collapse/Collapse.tsx | 2 +- components/progress/progress.tsx | 6 +++--- components/tabs/TabBar.tsx | 2 +- components/timeline/Timeline.tsx | 2 +- components/tree/DirectoryTree.tsx | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/button/button.tsx b/components/button/button.tsx index 2f01760638..b47e16a96b 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -120,7 +120,7 @@ class Button extends React.Component { loading: false, ghost: false, block: false, - htmlType: 'button', + htmlType: 'button' as ButtonProps['htmlType'], }; private delayTimeout: number; diff --git a/components/collapse/Collapse.tsx b/components/collapse/Collapse.tsx index 436ccad3f1..0fe9c53221 100644 --- a/components/collapse/Collapse.tsx +++ b/components/collapse/Collapse.tsx @@ -40,7 +40,7 @@ export default class Collapse extends React.Component { static defaultProps = { bordered: true, - expandIconPosition: 'left', + expandIconPosition: 'left' as CollapseProps['expandIconPosition'], }; renderExpandIcon = (panelProps: PanelProps = {}, prefixCls: string) => { diff --git a/components/progress/progress.tsx b/components/progress/progress.tsx index f4bcb662d7..c5b57651b5 100644 --- a/components/progress/progress.tsx +++ b/components/progress/progress.tsx @@ -43,14 +43,14 @@ export interface ProgressProps { export default class Progress extends React.Component { 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() { diff --git a/components/tabs/TabBar.tsx b/components/tabs/TabBar.tsx index 0df600e9c6..27a93aebc0 100644 --- a/components/tabs/TabBar.tsx +++ b/components/tabs/TabBar.tsx @@ -12,7 +12,7 @@ import { ConfigConsumerProps, ConfigConsumer } from '../config-provider'; export default class TabBar extends React.Component { static defaultProps = { animated: true, - type: 'line', + type: 'line' as TabsProps['type'], }; renderTabBar = ({ direction }: ConfigConsumerProps) => { diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index 7f2f902c43..2bc67ccf8b 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -21,7 +21,7 @@ export default class Timeline extends React.Component { static defaultProps = { reverse: false, - mode: '', + mode: '' as TimelineProps['mode'], }; renderTimeline = ({ getPrefixCls, direction }: ConfigConsumerProps) => { diff --git a/components/tree/DirectoryTree.tsx b/components/tree/DirectoryTree.tsx index fd55d05750..13c0d758cc 100644 --- a/components/tree/DirectoryTree.tsx +++ b/components/tree/DirectoryTree.tsx @@ -39,7 +39,7 @@ function getTreeData({ treeData, children }: DirectoryTreeProps) { class DirectoryTree extends React.Component { static defaultProps = { showIcon: true, - expandAction: 'click', + expandAction: 'click' as DirectoryTreeProps['expandAction'], }; static getDerivedStateFromProps(nextProps: DirectoryTreeProps) { From ecf4e47647180fd072499f23a6dc84a82a31bef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Sun, 29 Mar 2020 10:48:59 +0800 Subject: [PATCH 3/5] docs: Update icons doc (#22709) * docs: Update icons doc * Update index.en-US.md --- components/icon/index.en-US.md | 6 +++++- components/icon/index.zh-CN.md | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components/icon/index.en-US.md b/components/icon/index.en-US.md index e611a7b726..f7afdcc831 100644 --- a/components/icon/index.en-US.md +++ b/components/icon/index.en-US.md @@ -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 diff --git a/components/icon/index.zh-CN.md b/components/icon/index.zh-CN.md index 12edd603be..eff3ddfce8 100644 --- a/components/icon/index.zh-CN.md +++ b/components/icon/index.zh-CN.md @@ -6,7 +6,11 @@ title: Icon toc: false --- -语义化的矢量图形。 +语义化的矢量图形。使用图标组件,你需要安装 `@ant-design/icons` 图标组件包: + +```bash +npm install --save @ant-design/icons +``` ## 设计师专属 From d95dc831dd75b657e3d10396cc89d808c2c42a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Sun, 29 Mar 2020 12:38:12 +0800 Subject: [PATCH 4/5] fix: Drawer close btn style (#22710) * fix: Drawer close btn style * fix lint * snapshot * update snapshot --- .../__tests__/__snapshots__/components.test.js.snap | 3 +++ .../__tests__/__snapshots__/Drawer.test.js.snap | 7 +++++++ .../__tests__/__snapshots__/DrawerEvent.test.js.snap | 1 + components/drawer/index.tsx | 12 +++++++++++- components/drawer/style/drawer.less | 11 +++++++---- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index 86e4ef19af..1033e519c0 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -6477,6 +6477,7 @@ exports[`ConfigProvider components Drawer configProvider 1`] = ` ) diff --git a/components/drawer/style/drawer.less b/components/drawer/style/drawer.less index 1801cba1e7..627df9c5bb 100644 --- a/components/drawer/style/drawer.less +++ b/components/drawer/style/drawer.less @@ -157,14 +157,12 @@ right: 0; z-index: @zindex-popup-close; display: block; - width: 56px; - height: 56px; - padding: 0; + padding: 20px; color: @text-color-secondary; font-weight: 700; font-size: @font-size-lg; font-style: normal; - line-height: 56px; + line-height: 1; text-align: center; text-transform: none; text-decoration: none; @@ -180,6 +178,11 @@ color: @icon-color-hover; text-decoration: none; } + + .@{drawer-prefix-cls}-header-no-title & { + margin-right: var(--scroll-bar); + padding-right: calc(20px - var(--scroll-bar)); + } } &-header { From 702cb61586ca253d1088b89d0ed3225e6efc6141 Mon Sep 17 00:00:00 2001 From: zombiej Date: Sun, 29 Mar 2020 14:07:42 +0800 Subject: [PATCH 5/5] chore: Fix jest filter --- .jest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.jest.js b/.jest.js index e360991e71..7ed3f25067 100644 --- a/.jest.js +++ b/.jest.js @@ -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 = {