chore: merge master

This commit is contained in:
zombiej 2020-05-23 15:00:18 +08:00
commit 7c260c03a5
17 changed files with 76 additions and 44 deletions

14
.bundle-analyzerrc.json Normal file
View File

@ -0,0 +1,14 @@
{
"files": [
{
"test": "./dist/antd.min.js",
"maxSize": "300 kB",
"compression": "gzip"
},
{
"test": "./dist/antd.min.css",
"maxSize": "65 kB",
"compression": "gzip"
}
]
}

View File

@ -16,9 +16,4 @@ module.exports = {
testEnvironment: 'node',
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],
globals: {
'ts-jest': {
tsConfigFile: './tsconfig.test.json',
},
},
};

View File

@ -60,8 +60,7 @@ describe('Alert', () => {
const testIt = process.env.REACT === '15' ? it.skip : it;
testIt('ErrorBoundary', () => {
// TODO: Change to @ts-expect-error once typescript is at 3.9
// @ts-ignore
// @ts-expect-error
// eslint-disable-next-line react/jsx-no-undef
const ThrowError = () => <NotExisted />;
const wrapper = mount(

View File

@ -39,6 +39,7 @@ exports[`AutoComplete legacy dataSource should accept react element option 1`] =
style="height:0;width:0;overflow:hidden"
>
<div
aria-label="ReactNode"
aria-selected="false"
id="undefined_list_0"
role="option"

View File

@ -91,6 +91,8 @@ export interface CascaderProps {
disabled?: boolean;
/** 是否支持清除 */
allowClear?: boolean;
/** 自动获取焦点 */
autoFocus?: boolean;
showSearch?: boolean | ShowSearchType;
notFoundContent?: React.ReactNode;
loadData?: (selectedOptions?: CascaderOptionType[]) => void;

View File

@ -21749,6 +21749,7 @@ exports[`ConfigProvider components Select configProvider 1`] = `
role="option"
/>
<div
aria-label="Light"
aria-selected="false"
id="undefined_list_1"
role="option"
@ -21869,6 +21870,7 @@ exports[`ConfigProvider components Select configProvider componentSize large 1`]
role="option"
/>
<div
aria-label="Light"
aria-selected="false"
id="undefined_list_1"
role="option"
@ -21989,6 +21991,7 @@ exports[`ConfigProvider components Select configProvider componentSize middle 1`
role="option"
/>
<div
aria-label="Light"
aria-selected="false"
id="undefined_list_1"
role="option"
@ -22109,6 +22112,7 @@ exports[`ConfigProvider components Select configProvider virtual and dropdownMat
role="option"
/>
<div
aria-label="Light"
aria-selected="false"
id="undefined_list_1"
role="option"
@ -22229,6 +22233,7 @@ exports[`ConfigProvider components Select normal 1`] = `
role="option"
/>
<div
aria-label="Light"
aria-selected="false"
id="undefined_list_1"
role="option"
@ -22349,6 +22354,7 @@ exports[`ConfigProvider components Select prefixCls 1`] = `
role="option"
/>
<div
aria-label="Light"
aria-selected="false"
id="undefined_list_1"
role="option"

View File

@ -383,6 +383,7 @@ exports[`List.pagination should change page size work 2`] = `
style="height: 0px; width: 0px; overflow: hidden;"
>
<div
aria-label="10 / page"
aria-selected="false"
id="rc_select_TEST_OR_SSR_list_0"
role="option"
@ -390,6 +391,7 @@ exports[`List.pagination should change page size work 2`] = `
10
</div>
<div
aria-label="20 / page"
aria-selected="false"
id="rc_select_TEST_OR_SSR_list_1"
role="option"

View File

@ -111,3 +111,7 @@ Virtual scroll internal set item height as `32px`. You need to adjust `listItemH
```
Note: `listItemHeight` and `listHeight` are internal props. Please only modify when necessary.
### Why a11y test report missing `aria-` props?
Select only create a11y auxiliary node when operating on. Please open Select and retry. For `aria-label` & `aria-labelledby` miss warning, please add related prop to Select with your own requirement.

View File

@ -114,3 +114,7 @@ title: Select
```
注意:`listItemHeight` 和 `listHeight` 为内部属性,如无必要,请勿修改该值。
### 为何无障碍测试会报缺失 `aria-` 属性?
Select 无障碍辅助元素仅在弹窗展开时创建,因而当你在进行无障碍检测时请先打开下拉后再进行测试。对于 `aria-label``aria-labelledby` 属性缺失警告,请自行为 Select 组件添加相应无障碍属性。

View File

@ -222,7 +222,6 @@
@table-padding-vertical-sm: 4px;
@table-padding-horizontal-sm: 4px;
@table-selection-column-width: 54px;
@table-selection-extra-right: -4px;
// Statistic
// ---

View File

@ -583,7 +583,7 @@
@table-filter-dropdown-bg: @component-background;
@table-expand-icon-bg: @component-background;
@table-selection-column-width: 60px;
@table-selection-extra-right: -10px;
@table-selection-extra-right: 0;
// Tag
// --

View File

@ -360,6 +360,8 @@
table tr th&-selection-column,
table tr td&-selection-column {
padding-right: @padding-xs;
padding-left: @padding-xs;
text-align: center;
.@{ant-prefix}-radio-wrapper {

View File

@ -169,4 +169,4 @@ You can also eject your application using [yarn run eject](https://facebook.gith
Finally, we used antd with create-react-app successfully, the source code of this guide was pushed to [create-react-app-antd](https://github.com/ant-design/create-react-app-antd) which you could clone and use it directly.
Next part, We will intruduce how to use antd in [TypeScript](/docs/react/use-in-typescript) and [Umi](/docs/react/practical-projects), let's keep moving!
Next part, We will introduce how to use antd in [TypeScript](/docs/react/use-in-typescript) and [Umi](/docs/react/practical-projects), let's keep moving!

View File

@ -131,7 +131,7 @@
"rc-progress": "~3.0.0",
"rc-rate": "~2.6.0",
"rc-resize-observer": "^0.2.0",
"rc-select": "~10.3.0",
"rc-select": "~10.3.5",
"rc-slider": "~9.2.3",
"rc-steps": "~3.6.0",
"rc-switch": "~3.1.0",
@ -153,6 +153,7 @@
"@ant-design/colors": "^4.0.0",
"@ant-design/hitu": "^0.0.0-alpha.13",
"@ant-design/tools": "^8.2.0",
"@bundle-analyzer/webpack-plugin": "^0.5.1",
"@qixian.cs/github-contributors-list": "^1.0.3",
"@stackblitz/sdk": "^1.3.0",
"@types/classnames": "^2.2.8",
@ -168,8 +169,8 @@
"@types/react-color": "^3.0.1",
"@types/react-dom": "^16.9.5",
"@types/warning": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^2.19.0",
"@typescript-eslint/parser": "^2.19.0",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"antd-img-crop": "^3.1.1",
"antd-pro-merge-less": "^3.0.3",
"antd-theme-generator": "1.2.2",

View File

@ -40,27 +40,25 @@ const LIST_CN: Recommend[] = [
const LIST_EN: Recommend[] = [
{
title: 'Ant Design 4.0 is out!',
title: 'Ant Experience Technology Department Wants You!',
description:
'⚡️ Smaller, faster, prettier and more powerfull, finally Ant Design 4.0 right here.',
img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*G0nDS5-aESoAAAAAAAAAAABkARQnAQ',
href: 'https://github.com/ant-design/ant-design/issues/21656',
'⚡️ Our vision is To Lead Global Experience Technology, to Create First-Class User Experience.. Welcome to join us.',
img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*BPVATKTgfXwAAAAAAAAAAABkARQnAQ',
href: 'https://www.yuque.com/uf44r1/wqrwsg/alwufg',
popularize: true,
},
{
title: 'Introduce AntV',
description: '✨ New player of front-end data visualization',
img:
'https://gw.alipayobjects.com/zos/antfincdn/Vb5TpaLRSn/089e332b-a54c-421e-a4f0-f2a3480e2f42.png',
href:
'https://medium.com/ant-design/introduce-antv-a-new-player-in-data-visualization-90ca999cfb08',
title: 'Chart Library G2Plot 1.0 has Come!',
description:
'📈 G2Plot 1.0 supports 40+ types of charts, including built-in statistic & analysis components and complicated interactions. Now it is ready for use out of the box.',
img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*UsnLRpUZChQAAAAAAAAAAABkARQnAQ',
href: 'https://zhuanlan.zhihu.com/p/113888415',
},
{
title: 'G2Plot: a charting library',
description: '📊 A charting library based on the grammar of graphics',
img:
'https://gw.alipayobjects.com/zos/antfincdn/NBwf%24mYoDf/d100a715-d763-4bc5-b801-23b7f56b665d.png',
href: 'https://github.com/antvis/G2Plot',
title: 'Dark Theme of Ant Design',
description: '🌃 Let us take a look at how to design the dark theme of Ant Design.',
img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*pxK_TboMzL8AAAAAAAAAAABkARQnAQ',
href: 'https://zhuanlan.zhihu.com/p/112470365',
},
];

View File

@ -1,6 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true
}
}

View File

@ -3,6 +3,7 @@
const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig');
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const BundleAnalyzerPluginCom = require('@bundle-analyzer/webpack-plugin');
const EsbuildPlugin = require('esbuild-webpack-plugin').default;
const darkVars = require('./scripts/dark-vars');
const compactVars = require('./scripts/compact-vars');
@ -52,6 +53,17 @@ function injectWarningCondition(config) {
});
}
function addBundleAnalyzerPluginCom(config) {
if (!process.env.CIRCLECI || process.env.RUN_ENV !== 'PRODUCTION') {
return;
}
config.plugins.push(
new BundleAnalyzerPluginCom({
token: process.env.BUNDLE_ANALYZER_TOKEN,
}),
);
}
function processWebpackThemeConfig(themeConfig, theme, vars) {
themeConfig.forEach(config => {
ignoreMomentLocale(config);
@ -102,8 +114,6 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
config.optimization.minimizer[0] = new EsbuildPlugin();
}
// skip codesandbox ci
if (!process.env.CSB_REPO) {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
@ -111,7 +121,8 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
reportFilename: '../report.html',
}),
);
}
addBundleAnalyzerPluginCom(config);
});
processWebpackThemeConfig(webpackDarkConfig, 'dark', darkVars);