chore: merge master

This commit is contained in:
zombiej 2022-06-27 14:55:59 +08:00
commit b7013a138b
9 changed files with 29 additions and 38 deletions

View File

@ -17,7 +17,7 @@ module.exports = {
}, },
settings: { settings: {
react: { react: {
version: '16.9', version: 'detect',
}, },
polyfills: ['Promise', 'URL'], polyfills: ['Promise', 'URL'],
}, },

View File

@ -129,6 +129,7 @@
// pointer-events: none; // pointer-events: none;
// &-content { // &-content {
// --antd-arrow-background-color: @popover-bg;
// position: absolute; // position: absolute;
// top: 0; // top: 0;
// right: 0; // right: 0;
@ -141,7 +142,7 @@
// background-color: @popover-bg; // background-color: @popover-bg;
// content: ''; // content: '';
// pointer-events: auto; // pointer-events: auto;
// .roundedArrow(@popover-arrow-width, 5px, @popover-bg); // .roundedArrow(@popover-arrow-width, 5px);
// } // }
// } // }

View File

@ -27,7 +27,7 @@ Display statistic number.
| suffix | The suffix node of value | ReactNode | - | | | suffix | The suffix node of value | ReactNode | - | |
| title | Display title | ReactNode | - | | | title | Display title | ReactNode | - | |
| value | Display value | string \| number | - | | | value | Display value | string \| number | - | |
| valueStyle | Set value css style | CSSProperties | - | | | valueStyle | Set value section style | CSSProperties | - | |
#### Statistic.Countdown #### Statistic.Countdown
@ -38,6 +38,6 @@ Display statistic number.
| suffix | The suffix node of value | ReactNode | - | | | suffix | The suffix node of value | ReactNode | - | |
| title | Display title | ReactNode | - | | | title | Display title | ReactNode | - | |
| value | Set target countdown time | number \| dayjs | - | | | value | Set target countdown time | number \| dayjs | - | |
| valueStyle | Set value css style | CSSProperties | - | | | valueStyle | Set value section style | CSSProperties | - | |
| onFinish | Trigger when time's up | () => void | - | | | onFinish | Trigger when time's up | () => void | - | |
| onChange | Trigger when time's changing | (value: number) => void | - | 4.16.0 | | onChange | Trigger when time's changing | (value: number) => void | - | 4.16.0 |

View File

@ -18,7 +18,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/rcBNhLBrKbE/Statistic.svg
#### Statistic #### Statistic
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
| ---------------- | ---------------- | -------------------- | ------ | ----- | | ---------------- | ------------------ | -------------------- | ------ | ----- |
| decimalSeparator | 设置小数点 | string | `.` | | | decimalSeparator | 设置小数点 | string | `.` | |
| formatter | 自定义数值展示 | (value) => ReactNode | - | | | formatter | 自定义数值展示 | (value) => ReactNode | - | |
| groupSeparator | 设置千分位标识符 | string | `,` | | | groupSeparator | 设置千分位标识符 | string | `,` | |
@ -28,7 +28,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/rcBNhLBrKbE/Statistic.svg
| suffix | 设置数值的后缀 | ReactNode | - | | | suffix | 设置数值的后缀 | ReactNode | - | |
| title | 数值的标题 | ReactNode | - | | | title | 数值的标题 | ReactNode | - | |
| value | 数值内容 | string \| number | - | | | value | 数值内容 | string \| number | - | |
| valueStyle | 设置数值的样式 | CSSProperties | - | | | valueStyle | 设置数值区域的样式 | CSSProperties | - | |
#### Statistic.Countdown #### Statistic.Countdown
@ -39,6 +39,6 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/rcBNhLBrKbE/Statistic.svg
| suffix | 设置数值的后缀 | ReactNode | - | | | suffix | 设置数值的后缀 | ReactNode | - | |
| title | 数值的标题 | ReactNode | - | | | title | 数值的标题 | ReactNode | - | |
| value | 数值内容 | number \| dayjs | - | | | value | 数值内容 | number \| dayjs | - | |
| valueStyle | 设置数值的样式 | CSSProperties | - | | | valueStyle | 设置数值区域的样式 | CSSProperties | - | |
| onFinish | 倒计时完成时触发 | () => void | - | | | onFinish | 倒计时完成时触发 | () => void | - | |
| onChange | 倒计时时间变化时触发 | (value: number) => void | - | 4.16.0 | | onChange | 倒计时时间变化时触发 | (value: number) => void | - | 4.16.0 |

View File

@ -326,7 +326,6 @@ describe('Table.rowSelection', () => {
}); });
expect(onChange).toHaveBeenLastCalledWith([3, 0, 1, 2]); expect(onChange).toHaveBeenLastCalledWith([3, 0, 1, 2]);
fireEvent.click(allElement()); fireEvent.click(allElement());
console.log(baseElement.innerHTML);
expect(onChange).toHaveBeenLastCalledWith([]); expect(onChange).toHaveBeenLastCalledWith([]);
// Reset last select key when select all // Reset last select key when select all

View File

@ -40,22 +40,12 @@ const App: React.FC = () => {
}; };
const remove = (targetKey: string) => { const remove = (targetKey: string) => {
let lastIndex = -1; const targetIndex = panes.findIndex(pane => pane.key === targetKey);
panes.forEach((pane, i) => {
if (pane.key === targetKey) {
lastIndex = i - 1;
}
});
if (panes.length && activeKey === targetKey) {
let newActiveKey: string;
if (lastIndex >= 0) {
newActiveKey = panes[lastIndex].key;
} else {
newActiveKey = panes[0].key;
}
setActiveKey(newActiveKey);
}
const newPanes = panes.filter(pane => pane.key !== targetKey); const newPanes = panes.filter(pane => pane.key !== targetKey);
if (newPanes.length && targetKey === activeKey) {
const { key } = newPanes[targetIndex === newPanes.length ? targetIndex - 1 : targetIndex];
setActiveKey(key);
}
setPanes(newPanes); setPanes(newPanes);
}; };

View File

@ -11,7 +11,7 @@ Here are the frequently asked questions about Ant Design and antd that you shoul
There is currently no plan to add support for Sass/Stylus(etc.) style files, but using tools on Google you can easily convert the provided Less files to your desired style format. There is currently no plan to add support for Sass/Stylus(etc.) style files, but using tools on Google you can easily convert the provided Less files to your desired style format.
## Is there a difference between undefined and null in the controlled components of antd? ## Is there a difference between `undefined` and `null` in the controlled components of `antd`?
**Yes. antd will treats `undefined` as uncontrolled but `null` as controlled components which means empty value of it.** **Yes. antd will treats `undefined` as uncontrolled but `null` as controlled components which means empty value of it.**

View File

@ -175,7 +175,7 @@
"@types/jest": "^28.0.0", "@types/jest": "^28.0.0",
"@types/jest-axe": "^3.5.3", "@types/jest-axe": "^3.5.3",
"@types/jest-environment-puppeteer": "^5.0.0", "@types/jest-environment-puppeteer": "^5.0.0",
"@types/jest-image-snapshot": "^4.1.0", "@types/jest-image-snapshot": "^5.1.0",
"@types/lodash": "^4.14.139", "@types/lodash": "^4.14.139",
"@types/puppeteer": "^5.4.0", "@types/puppeteer": "^5.4.0",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
@ -279,7 +279,7 @@
"react-sticky": "^6.0.3", "react-sticky": "^6.0.3",
"react-window": "^1.8.5", "react-window": "^1.8.5",
"remark": "^14.0.1", "remark": "^14.0.1",
"remark-cli": "^10.0.0", "remark-cli": "^11.0.0",
"remark-lint": "^9.0.0", "remark-lint": "^9.0.0",
"remark-preset-lint-recommended": "^6.0.0", "remark-preset-lint-recommended": "^6.0.0",
"remove-files-webpack-plugin": "1.4.4", "remove-files-webpack-plugin": "1.4.4",

View File

@ -30,9 +30,10 @@ function alertBabelConfig(rules) {
} }
const ssrCssFileName = `ssr-${Date.now()}.css`; const ssrCssFileName = `ssr-${Date.now()}.css`;
const port = process.env.DEV_PORT || 8001;
module.exports = { module.exports = {
port: 8001, port,
hash: true, hash: true,
source: { source: {
components: './components', components: './components',
@ -202,7 +203,7 @@ module.exports = {
}, },
devServerConfig: { devServerConfig: {
public: process.env.DEV_HOST || 'localhost', public: `${process.env.DEV_HOST || 'localhost'}:${port}`,
disableHostCheck: !!process.env.DEV_HOST, disableHostCheck: !!process.env.DEV_HOST,
}, },