From bac41780ef8d0855a6880dc271f18a24e5cc8d3b Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 21 Nov 2022 13:58:27 +0800 Subject: [PATCH 001/252] chore: change dumi dev port to 8001 (#38773) * chore: improve dumirc config * Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3d506face381..3310ddec3f27 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "site": "dumi build && cp .surgeignore _site", "sort": "npx sort-package-json", "sort-api": "antd-tools run sort-api-table", - "start": "dumi dev", + "start": "PORT=8001 dumi dev", "test": "jest --config .jest.js --cache=false", "test:update": "jest --config .jest.js --cache=false -u", "test-all": "sh -e ./scripts/test-all.sh", From 0c446bc9c3522743dfba854f7eccd4977d1aff91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Mon, 21 Nov 2022 14:00:32 +0800 Subject: [PATCH 002/252] docs: auto use Chinese mirror if in mirror (#38776) * docs: auto use chinese mirror if in mirror * Update .dumi/theme/themeConfig.ts * Update .dumi/theme/themeConfig.ts Co-authored-by: Amumu --- .dumi/pages/index/components/BannerRecommends.tsx | 2 +- .dumi/theme/themeConfig.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.dumi/pages/index/components/BannerRecommends.tsx b/.dumi/pages/index/components/BannerRecommends.tsx index 3d5ed1c7326b..0f0c5af5c265 100644 --- a/.dumi/pages/index/components/BannerRecommends.tsx +++ b/.dumi/pages/index/components/BannerRecommends.tsx @@ -54,7 +54,7 @@ export default function BannerRecommends({ extras = [], icons = [] }: BannerReco > {first3.map((extra, index) => { if (!extra) { - return ; + return ; } const icon = icons.find((icon) => icon.name === extra.source); return ( diff --git a/.dumi/theme/themeConfig.ts b/.dumi/theme/themeConfig.ts index 50c69e6d00e9..cb341ca498f6 100644 --- a/.dumi/theme/themeConfig.ts +++ b/.dumi/theme/themeConfig.ts @@ -1,3 +1,6 @@ +const chineseMirror = + typeof location !== 'undefined' && location.hostname.includes('.antgroup.com'); + export default { categoryOrder: { 'Ant Design': 0, @@ -43,7 +46,7 @@ export default { 'Template Document': 3, }, docVersions: { - '4.x': 'https://4x.ant.design', + '4.x': chineseMirror ? 'https://4x-ant-design.antgroup.com/' : 'https://4x.ant.design', '3.x': 'https://3x.ant.design', '2.x': 'https://2x.ant.design', '1.x': 'https://1x.ant.design', From 14316b345e9e3f49cf9d3d95043b66b840b7db5f Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Mon, 21 Nov 2022 14:12:59 +0800 Subject: [PATCH 003/252] fix: delete Chinese locale (#38781) --- .dumi/theme/builtins/ComponentOverview/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.dumi/theme/builtins/ComponentOverview/index.tsx b/.dumi/theme/builtins/ComponentOverview/index.tsx index 94bb7e72379e..e2751cd7a6a5 100644 --- a/.dumi/theme/builtins/ComponentOverview/index.tsx +++ b/.dumi/theme/builtins/ComponentOverview/index.tsx @@ -114,7 +114,10 @@ const Overview: React.FC = () => { .concat([ { title: locale === 'zh-CN' ? '重型组件' : 'Others', - children: proComponentsList, + children: + locale === 'zh-CN' + ? proComponentsList.map((component) => ({ ...component, subtitle: '' })) + : proComponentsList, }, ]); }, [data, locale]); From 588a912609cd95434e40c3865d02bef1a074146e Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Mon, 21 Nov 2022 14:30:51 +0800 Subject: [PATCH 004/252] fix: fix OverviewPage style (#38782) --- .dumi/theme/builtins/ComponentOverview/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/.dumi/theme/builtins/ComponentOverview/index.tsx b/.dumi/theme/builtins/ComponentOverview/index.tsx index e2751cd7a6a5..0e638d0d86d6 100644 --- a/.dumi/theme/builtins/ComponentOverview/index.tsx +++ b/.dumi/theme/builtins/ComponentOverview/index.tsx @@ -29,7 +29,6 @@ const useStyle = () => { align-items: center; justify-content: center; height: 152px; - background-color: ${token.colorBgElevated}; `, componentsOverviewCard: css` cursor: pointer; From 33776d01950762a20bae61e675f7063719c81b55 Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Mon, 21 Nov 2022 16:34:21 +0800 Subject: [PATCH 005/252] fix: delete Chinese locale (#38790) --- .dumi/theme/builtins/ComponentOverview/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.dumi/theme/builtins/ComponentOverview/index.tsx b/.dumi/theme/builtins/ComponentOverview/index.tsx index 0e638d0d86d6..92da8b444443 100644 --- a/.dumi/theme/builtins/ComponentOverview/index.tsx +++ b/.dumi/theme/builtins/ComponentOverview/index.tsx @@ -115,8 +115,8 @@ const Overview: React.FC = () => { title: locale === 'zh-CN' ? '重型组件' : 'Others', children: locale === 'zh-CN' - ? proComponentsList.map((component) => ({ ...component, subtitle: '' })) - : proComponentsList, + ? proComponentsList + : proComponentsList.map((component) => ({ ...component, subtitle: '' })), }, ]); }, [data, locale]); From 2de26c0cbdbaca44c1fafc37f36698624e02ed6c Mon Sep 17 00:00:00 2001 From: karasu Date: Mon, 21 Nov 2022 16:40:59 +0800 Subject: [PATCH 006/252] fix: collapsed inline menu style (#38791) --- components/layout/style/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout/style/index.tsx b/components/layout/style/index.tsx index 194297dc2268..ef0b63507e8c 100644 --- a/components/layout/style/index.tsx +++ b/components/layout/style/index.tsx @@ -109,7 +109,7 @@ const genLayoutStyle: GenerateStyle = (token) => { marginTop: -0.1, paddingTop: 0.1, - [`${antCls}-menu${antCls}menu-inline-collapsed`]: { + [`${antCls}-menu${antCls}-menu-inline-collapsed`]: { width: 'auto', }, }, From 91b25d554e4724da834b68b26cb58edb144ad953 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Mon, 21 Nov 2022 17:12:10 +0800 Subject: [PATCH 007/252] feat: empty simple in dark theme (#38785) * feat: empty simple in dark theme * chore: fix lint * chore: update snapshot * chore: update snaot --- .../__snapshots__/demo-extend.test.ts.snap | 30 +- .../__snapshots__/demo-extend.test.ts.snap | 12 +- .../__snapshots__/index.test.tsx.snap | 12 +- .../__snapshots__/components.test.tsx.snap | 126 +- .../__snapshots__/demo-extend.test.ts.snap | 48 +- .../__tests__/__snapshots__/demo.test.ts.snap | 30 +- components/empty/simple.tsx | 44 +- .../__snapshots__/demo-extend.test.ts.snap | 6 +- .../__snapshots__/demo-extend.test.ts.snap | 12 +- .../__snapshots__/demo-extend.test.ts.snap | 6 +- .../__tests__/__snapshots__/demo.test.ts.snap | 6 +- .../__snapshots__/empty.test.tsx.snap | 6 +- .../__snapshots__/index.test.tsx.snap | 6 +- .../__snapshots__/index.test.tsx.snap | 1206 ++++++++--------- .../__snapshots__/demo-extend.test.ts.snap | 12 +- .../__snapshots__/demo-extend.test.ts.snap | 6 +- .../Table.pagination.test.tsx.snap | 6 +- .../__snapshots__/Table.test.tsx.snap | 12 +- .../__snapshots__/empty.test.tsx.snap | 18 +- .../__snapshots__/demo-extend.test.ts.snap | 78 +- .../__tests__/__snapshots__/demo.test.ts.snap | 78 +- .../__snapshots__/index.test.tsx.snap | 24 +- .../__snapshots__/demo-extend.test.ts.snap | 12 +- 23 files changed, 907 insertions(+), 889 deletions(-) diff --git a/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap index d550b03f79cf..118dc1eb42f1 100644 --- a/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -679,20 +679,20 @@ exports[`renders ./components/auto-complete/demo/form-debug.tsx extend context c @@ -827,20 +827,20 @@ exports[`renders ./components/auto-complete/demo/form-debug.tsx extend context c @@ -1115,20 +1115,20 @@ exports[`renders ./components/auto-complete/demo/form-debug.tsx extend context c @@ -1332,20 +1332,20 @@ exports[`renders ./components/auto-complete/demo/form-debug.tsx extend context c @@ -1558,20 +1558,20 @@ exports[`renders ./components/auto-complete/demo/form-debug.tsx extend context c diff --git a/components/cascader/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/cascader/__tests__/__snapshots__/demo-extend.test.ts.snap index adb0cda69d66..cda26a0624bf 100644 --- a/components/cascader/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/cascader/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -3127,20 +3127,20 @@ exports[`renders ./components/cascader/demo/status.tsx extend context correctly @@ -3277,20 +3277,20 @@ exports[`renders ./components/cascader/demo/status.tsx extend context correctly diff --git a/components/cascader/__tests__/__snapshots__/index.test.tsx.snap b/components/cascader/__tests__/__snapshots__/index.test.tsx.snap index d3290c6e86eb..24f720cdce61 100644 --- a/components/cascader/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/cascader/__tests__/__snapshots__/index.test.tsx.snap @@ -1663,20 +1663,20 @@ exports[`Cascader should render not found content 1`] = ` @@ -1738,20 +1738,20 @@ exports[`Cascader should show not found content when options.length is 0 1`] = ` diff --git a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap index f2d0d5f72e46..a18eb46a94dd 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap @@ -26844,20 +26844,20 @@ exports[`ConfigProvider components Table configProvider 1`] = ` @@ -27151,20 +27151,20 @@ exports[`ConfigProvider components Table configProvider componentDisabled 1`] = @@ -27456,20 +27456,20 @@ exports[`ConfigProvider components Table configProvider componentSize large 1`] @@ -27761,20 +27761,20 @@ exports[`ConfigProvider components Table configProvider componentSize middle 1`] @@ -28066,20 +28066,20 @@ exports[`ConfigProvider components Table configProvider virtual and dropdownMatc @@ -28371,20 +28371,20 @@ exports[`ConfigProvider components Table normal 1`] = ` @@ -28676,20 +28676,20 @@ exports[`ConfigProvider components Table prefixCls 1`] = ` @@ -38452,20 +38452,20 @@ exports[`ConfigProvider components Transfer configProvider 1`] = ` @@ -38611,20 +38611,20 @@ exports[`ConfigProvider components Transfer configProvider 1`] = ` @@ -38724,20 +38724,20 @@ exports[`ConfigProvider components Transfer configProvider componentDisabled 1`] @@ -38884,20 +38884,20 @@ exports[`ConfigProvider components Transfer configProvider componentDisabled 1`] @@ -38996,20 +38996,20 @@ exports[`ConfigProvider components Transfer configProvider componentSize large 1 @@ -39155,20 +39155,20 @@ exports[`ConfigProvider components Transfer configProvider componentSize large 1 @@ -39267,20 +39267,20 @@ exports[`ConfigProvider components Transfer configProvider componentSize middle @@ -39426,20 +39426,20 @@ exports[`ConfigProvider components Transfer configProvider componentSize middle @@ -39538,20 +39538,20 @@ exports[`ConfigProvider components Transfer configProvider virtual and dropdownM @@ -39697,20 +39697,20 @@ exports[`ConfigProvider components Transfer configProvider virtual and dropdownM @@ -39809,20 +39809,20 @@ exports[`ConfigProvider components Transfer normal 1`] = ` @@ -39968,20 +39968,20 @@ exports[`ConfigProvider components Transfer normal 1`] = ` @@ -40080,20 +40080,20 @@ exports[`ConfigProvider components Transfer prefixCls 1`] = ` @@ -40239,20 +40239,20 @@ exports[`ConfigProvider components Transfer prefixCls 1`] = ` diff --git a/components/empty/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/empty/__tests__/__snapshots__/demo-extend.test.ts.snap index 03bdfdb1c6d0..ee1460e22d1a 100644 --- a/components/empty/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/empty/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -172,20 +172,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx extend context corr @@ -290,20 +290,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx extend context corr @@ -417,20 +417,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx extend context corr @@ -689,20 +689,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx extend context corr @@ -978,20 +978,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx extend context corr @@ -1079,20 +1079,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx extend context corr @@ -1149,20 +1149,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx extend context corr @@ -1313,20 +1313,20 @@ exports[`renders ./components/empty/demo/simple.tsx extend context correctly 1`] diff --git a/components/empty/__tests__/__snapshots__/demo.test.ts.snap b/components/empty/__tests__/__snapshots__/demo.test.ts.snap index 5752f58728c1..e7971468d735 100644 --- a/components/empty/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/empty/__tests__/__snapshots__/demo.test.ts.snap @@ -367,20 +367,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx correctly 1`] = ` @@ -527,20 +527,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx correctly 1`] = ` @@ -628,20 +628,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx correctly 1`] = ` @@ -698,20 +698,20 @@ exports[`renders ./components/empty/demo/config-provider.tsx correctly 1`] = ` @@ -862,20 +862,20 @@ exports[`renders ./components/empty/demo/simple.tsx correctly 1`] = ` diff --git a/components/empty/simple.tsx b/components/empty/simple.tsx index a3a677648abf..3799586b3f1e 100644 --- a/components/empty/simple.tsx +++ b/components/empty/simple.tsx @@ -1,18 +1,36 @@ import * as React from 'react'; +import { useMemo } from 'react'; +import { TinyColor } from '@ctrl/tinycolor'; +import { useToken } from '../theme'; -const Simple = () => ( - - - - - - +const Simple = () => { + const [, token] = useToken(); + + const { colorFill, colorFillTertiary, colorFillQuaternary, colorBgContainer } = token; + + const { borderColor, shadowColor, contentColor } = useMemo( + () => ({ + borderColor: new TinyColor(colorFill).onBackground(colorBgContainer).toHexString(), + shadowColor: new TinyColor(colorFillTertiary).onBackground(colorBgContainer).toHexString(), + contentColor: new TinyColor(colorFillQuaternary).onBackground(colorBgContainer).toHexString(), + }), + [colorFill, colorFillTertiary, colorFillQuaternary, colorBgContainer], + ); + + return ( + + + + + + + - - -); + + ); +}; export default Simple; diff --git a/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap index 42199761596b..1b0f85e1865b 100644 --- a/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -709,20 +709,20 @@ exports[`renders ./components/input-number/demo/addon.tsx extend context correct diff --git a/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap index d360d4455dfd..ed6cec3996a3 100644 --- a/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -532,20 +532,20 @@ exports[`renders ./components/input/demo/addon.tsx extend context correctly 1`] @@ -3052,20 +3052,20 @@ Array [ diff --git a/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap index 2ee3c00d9c8e..2f689e7dcc99 100644 --- a/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1063,20 +1063,20 @@ exports[`renders ./components/list/demo/infinite-load.tsx extend context correct diff --git a/components/list/__tests__/__snapshots__/demo.test.ts.snap b/components/list/__tests__/__snapshots__/demo.test.ts.snap index 7b513e0dfc93..16c71090f22a 100644 --- a/components/list/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/list/__tests__/__snapshots__/demo.test.ts.snap @@ -1063,20 +1063,20 @@ exports[`renders ./components/list/demo/infinite-load.tsx correctly 1`] = ` diff --git a/components/list/__tests__/__snapshots__/empty.test.tsx.snap b/components/list/__tests__/__snapshots__/empty.test.tsx.snap index 992daf88024d..04461554400a 100644 --- a/components/list/__tests__/__snapshots__/empty.test.tsx.snap +++ b/components/list/__tests__/__snapshots__/empty.test.tsx.snap @@ -33,20 +33,20 @@ exports[`List renders empty list 1`] = ` diff --git a/components/list/__tests__/__snapshots__/index.test.tsx.snap b/components/list/__tests__/__snapshots__/index.test.tsx.snap index 7b504e5421a2..6b499bdb4603 100644 --- a/components/list/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/list/__tests__/__snapshots__/index.test.tsx.snap @@ -33,20 +33,20 @@ exports[`List rtl render component should be rendered correctly in RTL direction diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap b/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap index a947db85bc38..0b4cd8b09523 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap @@ -5547,20 +5547,20 @@ exports[`Locale Provider should display the text as ar 1`] = ` @@ -5772,20 +5772,20 @@ exports[`Locale Provider should display the text as ar 1`] = ` @@ -6843,20 +6843,20 @@ exports[`Locale Provider should display the text as ar 1`] = ` @@ -10650,20 +10650,20 @@ exports[`Locale Provider should display the text as az 1`] = ` @@ -10875,20 +10875,20 @@ exports[`Locale Provider should display the text as az 1`] = ` @@ -11946,20 +11946,20 @@ exports[`Locale Provider should display the text as az 1`] = ` @@ -15753,20 +15753,20 @@ exports[`Locale Provider should display the text as bg 1`] = ` @@ -15978,20 +15978,20 @@ exports[`Locale Provider should display the text as bg 1`] = ` @@ -17049,20 +17049,20 @@ exports[`Locale Provider should display the text as bg 1`] = ` @@ -20856,20 +20856,20 @@ exports[`Locale Provider should display the text as bn-bd 1`] = ` @@ -21081,20 +21081,20 @@ exports[`Locale Provider should display the text as bn-bd 1`] = ` @@ -22152,20 +22152,20 @@ exports[`Locale Provider should display the text as bn-bd 1`] = ` @@ -25959,20 +25959,20 @@ exports[`Locale Provider should display the text as by 1`] = ` @@ -26184,20 +26184,20 @@ exports[`Locale Provider should display the text as by 1`] = ` @@ -27255,20 +27255,20 @@ exports[`Locale Provider should display the text as by 1`] = ` @@ -31062,20 +31062,20 @@ exports[`Locale Provider should display the text as ca 1`] = ` @@ -31287,20 +31287,20 @@ exports[`Locale Provider should display the text as ca 1`] = ` @@ -32358,20 +32358,20 @@ exports[`Locale Provider should display the text as ca 1`] = ` @@ -36165,20 +36165,20 @@ exports[`Locale Provider should display the text as cs 1`] = ` @@ -36390,20 +36390,20 @@ exports[`Locale Provider should display the text as cs 1`] = ` @@ -37461,20 +37461,20 @@ exports[`Locale Provider should display the text as cs 1`] = ` @@ -41268,20 +41268,20 @@ exports[`Locale Provider should display the text as da 1`] = ` @@ -41493,20 +41493,20 @@ exports[`Locale Provider should display the text as da 1`] = ` @@ -42564,20 +42564,20 @@ exports[`Locale Provider should display the text as da 1`] = ` @@ -46371,20 +46371,20 @@ exports[`Locale Provider should display the text as de 1`] = ` @@ -46596,20 +46596,20 @@ exports[`Locale Provider should display the text as de 1`] = ` @@ -47667,20 +47667,20 @@ exports[`Locale Provider should display the text as de 1`] = ` @@ -51474,20 +51474,20 @@ exports[`Locale Provider should display the text as el 1`] = ` @@ -51699,20 +51699,20 @@ exports[`Locale Provider should display the text as el 1`] = ` @@ -52770,20 +52770,20 @@ exports[`Locale Provider should display the text as el 1`] = ` @@ -56577,20 +56577,20 @@ exports[`Locale Provider should display the text as en 1`] = ` @@ -56802,20 +56802,20 @@ exports[`Locale Provider should display the text as en 1`] = ` @@ -57873,20 +57873,20 @@ exports[`Locale Provider should display the text as en 1`] = ` @@ -61680,20 +61680,20 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` @@ -61905,20 +61905,20 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` @@ -62976,20 +62976,20 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` @@ -66783,20 +66783,20 @@ exports[`Locale Provider should display the text as es 1`] = ` @@ -67008,20 +67008,20 @@ exports[`Locale Provider should display the text as es 1`] = ` @@ -68079,20 +68079,20 @@ exports[`Locale Provider should display the text as es 1`] = ` @@ -71886,20 +71886,20 @@ exports[`Locale Provider should display the text as et 1`] = ` @@ -72111,20 +72111,20 @@ exports[`Locale Provider should display the text as et 1`] = ` @@ -73182,20 +73182,20 @@ exports[`Locale Provider should display the text as et 1`] = ` @@ -76989,20 +76989,20 @@ exports[`Locale Provider should display the text as fa 1`] = ` @@ -77214,20 +77214,20 @@ exports[`Locale Provider should display the text as fa 1`] = ` @@ -78285,20 +78285,20 @@ exports[`Locale Provider should display the text as fa 1`] = ` @@ -82092,20 +82092,20 @@ exports[`Locale Provider should display the text as fi 1`] = ` @@ -82317,20 +82317,20 @@ exports[`Locale Provider should display the text as fi 1`] = ` @@ -83388,20 +83388,20 @@ exports[`Locale Provider should display the text as fi 1`] = ` @@ -87195,20 +87195,20 @@ exports[`Locale Provider should display the text as fr 1`] = ` @@ -87420,20 +87420,20 @@ exports[`Locale Provider should display the text as fr 1`] = ` @@ -88491,20 +88491,20 @@ exports[`Locale Provider should display the text as fr 1`] = ` @@ -92298,20 +92298,20 @@ exports[`Locale Provider should display the text as fr 2`] = ` @@ -92523,20 +92523,20 @@ exports[`Locale Provider should display the text as fr 2`] = ` @@ -93594,20 +93594,20 @@ exports[`Locale Provider should display the text as fr 2`] = ` @@ -97401,20 +97401,20 @@ exports[`Locale Provider should display the text as fr 3`] = ` @@ -97626,20 +97626,20 @@ exports[`Locale Provider should display the text as fr 3`] = ` @@ -98697,20 +98697,20 @@ exports[`Locale Provider should display the text as fr 3`] = ` @@ -102504,20 +102504,20 @@ exports[`Locale Provider should display the text as ga 1`] = ` @@ -102729,20 +102729,20 @@ exports[`Locale Provider should display the text as ga 1`] = ` @@ -103800,20 +103800,20 @@ exports[`Locale Provider should display the text as ga 1`] = ` @@ -107607,20 +107607,20 @@ exports[`Locale Provider should display the text as gl 1`] = ` @@ -107832,20 +107832,20 @@ exports[`Locale Provider should display the text as gl 1`] = ` @@ -108903,20 +108903,20 @@ exports[`Locale Provider should display the text as gl 1`] = ` @@ -112710,20 +112710,20 @@ exports[`Locale Provider should display the text as he 1`] = ` @@ -112935,20 +112935,20 @@ exports[`Locale Provider should display the text as he 1`] = ` @@ -114006,20 +114006,20 @@ exports[`Locale Provider should display the text as he 1`] = ` @@ -117813,20 +117813,20 @@ exports[`Locale Provider should display the text as hi 1`] = ` @@ -118038,20 +118038,20 @@ exports[`Locale Provider should display the text as hi 1`] = ` @@ -119109,20 +119109,20 @@ exports[`Locale Provider should display the text as hi 1`] = ` @@ -122916,20 +122916,20 @@ exports[`Locale Provider should display the text as hr 1`] = ` @@ -123141,20 +123141,20 @@ exports[`Locale Provider should display the text as hr 1`] = ` @@ -124212,20 +124212,20 @@ exports[`Locale Provider should display the text as hr 1`] = ` @@ -128019,20 +128019,20 @@ exports[`Locale Provider should display the text as hu 1`] = ` @@ -128244,20 +128244,20 @@ exports[`Locale Provider should display the text as hu 1`] = ` @@ -129315,20 +129315,20 @@ exports[`Locale Provider should display the text as hu 1`] = ` @@ -133122,20 +133122,20 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` @@ -133347,20 +133347,20 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` @@ -134418,20 +134418,20 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` @@ -138225,20 +138225,20 @@ exports[`Locale Provider should display the text as id 1`] = ` @@ -138450,20 +138450,20 @@ exports[`Locale Provider should display the text as id 1`] = ` @@ -139521,20 +139521,20 @@ exports[`Locale Provider should display the text as id 1`] = ` @@ -143328,20 +143328,20 @@ exports[`Locale Provider should display the text as is 1`] = ` @@ -143553,20 +143553,20 @@ exports[`Locale Provider should display the text as is 1`] = ` @@ -144624,20 +144624,20 @@ exports[`Locale Provider should display the text as is 1`] = ` @@ -148431,20 +148431,20 @@ exports[`Locale Provider should display the text as it 1`] = ` @@ -148656,20 +148656,20 @@ exports[`Locale Provider should display the text as it 1`] = ` @@ -149727,20 +149727,20 @@ exports[`Locale Provider should display the text as it 1`] = ` @@ -153534,20 +153534,20 @@ exports[`Locale Provider should display the text as ja 1`] = ` @@ -153759,20 +153759,20 @@ exports[`Locale Provider should display the text as ja 1`] = ` @@ -154830,20 +154830,20 @@ exports[`Locale Provider should display the text as ja 1`] = ` @@ -158637,20 +158637,20 @@ exports[`Locale Provider should display the text as ka 1`] = ` @@ -158862,20 +158862,20 @@ exports[`Locale Provider should display the text as ka 1`] = ` @@ -159933,20 +159933,20 @@ exports[`Locale Provider should display the text as ka 1`] = ` @@ -163740,20 +163740,20 @@ exports[`Locale Provider should display the text as kk 1`] = ` @@ -163965,20 +163965,20 @@ exports[`Locale Provider should display the text as kk 1`] = ` @@ -165036,20 +165036,20 @@ exports[`Locale Provider should display the text as kk 1`] = ` @@ -168842,20 +168842,20 @@ exports[`Locale Provider should display the text as km 1`] = ` @@ -169066,20 +169066,20 @@ exports[`Locale Provider should display the text as km 1`] = ` @@ -170137,20 +170137,20 @@ exports[`Locale Provider should display the text as km 1`] = ` @@ -173944,20 +173944,20 @@ exports[`Locale Provider should display the text as kn 1`] = ` @@ -174169,20 +174169,20 @@ exports[`Locale Provider should display the text as kn 1`] = ` @@ -175240,20 +175240,20 @@ exports[`Locale Provider should display the text as kn 1`] = ` @@ -179047,20 +179047,20 @@ exports[`Locale Provider should display the text as ko 1`] = ` @@ -179272,20 +179272,20 @@ exports[`Locale Provider should display the text as ko 1`] = ` @@ -180343,20 +180343,20 @@ exports[`Locale Provider should display the text as ko 1`] = ` @@ -184150,20 +184150,20 @@ exports[`Locale Provider should display the text as ku 1`] = ` @@ -184375,20 +184375,20 @@ exports[`Locale Provider should display the text as ku 1`] = ` @@ -185446,20 +185446,20 @@ exports[`Locale Provider should display the text as ku 1`] = ` @@ -189253,20 +189253,20 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` @@ -189478,20 +189478,20 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` @@ -190549,20 +190549,20 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` @@ -194356,20 +194356,20 @@ exports[`Locale Provider should display the text as lt 1`] = ` @@ -194581,20 +194581,20 @@ exports[`Locale Provider should display the text as lt 1`] = ` @@ -195652,20 +195652,20 @@ exports[`Locale Provider should display the text as lt 1`] = ` @@ -199459,20 +199459,20 @@ exports[`Locale Provider should display the text as lv 1`] = ` @@ -199684,20 +199684,20 @@ exports[`Locale Provider should display the text as lv 1`] = ` @@ -200755,20 +200755,20 @@ exports[`Locale Provider should display the text as lv 1`] = ` @@ -204562,20 +204562,20 @@ exports[`Locale Provider should display the text as mk 1`] = ` @@ -204787,20 +204787,20 @@ exports[`Locale Provider should display the text as mk 1`] = ` @@ -205858,20 +205858,20 @@ exports[`Locale Provider should display the text as mk 1`] = ` @@ -209665,20 +209665,20 @@ exports[`Locale Provider should display the text as ml 1`] = ` @@ -209890,20 +209890,20 @@ exports[`Locale Provider should display the text as ml 1`] = ` @@ -210961,20 +210961,20 @@ exports[`Locale Provider should display the text as ml 1`] = ` @@ -214768,20 +214768,20 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` @@ -214993,20 +214993,20 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` @@ -216064,20 +216064,20 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` @@ -219871,20 +219871,20 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` @@ -220096,20 +220096,20 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` @@ -221167,20 +221167,20 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` @@ -224974,20 +224974,20 @@ exports[`Locale Provider should display the text as nb 1`] = ` @@ -225199,20 +225199,20 @@ exports[`Locale Provider should display the text as nb 1`] = ` @@ -226270,20 +226270,20 @@ exports[`Locale Provider should display the text as nb 1`] = ` @@ -230077,20 +230077,20 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` @@ -230302,20 +230302,20 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` @@ -231373,20 +231373,20 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` @@ -235180,20 +235180,20 @@ exports[`Locale Provider should display the text as nl 1`] = ` @@ -235405,20 +235405,20 @@ exports[`Locale Provider should display the text as nl 1`] = ` @@ -236476,20 +236476,20 @@ exports[`Locale Provider should display the text as nl 1`] = ` @@ -240283,20 +240283,20 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` @@ -240508,20 +240508,20 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` @@ -241579,20 +241579,20 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` @@ -245386,20 +245386,20 @@ exports[`Locale Provider should display the text as pl 1`] = ` @@ -245611,20 +245611,20 @@ exports[`Locale Provider should display the text as pl 1`] = ` @@ -246682,20 +246682,20 @@ exports[`Locale Provider should display the text as pl 1`] = ` @@ -250489,20 +250489,20 @@ exports[`Locale Provider should display the text as pt 1`] = ` @@ -250714,20 +250714,20 @@ exports[`Locale Provider should display the text as pt 1`] = ` @@ -251785,20 +251785,20 @@ exports[`Locale Provider should display the text as pt 1`] = ` @@ -255592,20 +255592,20 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` @@ -255817,20 +255817,20 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` @@ -256888,20 +256888,20 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` @@ -260695,20 +260695,20 @@ exports[`Locale Provider should display the text as ro 1`] = ` @@ -260920,20 +260920,20 @@ exports[`Locale Provider should display the text as ro 1`] = ` @@ -261991,20 +261991,20 @@ exports[`Locale Provider should display the text as ro 1`] = ` @@ -265798,20 +265798,20 @@ exports[`Locale Provider should display the text as ru 1`] = ` @@ -266023,20 +266023,20 @@ exports[`Locale Provider should display the text as ru 1`] = ` @@ -267094,20 +267094,20 @@ exports[`Locale Provider should display the text as ru 1`] = ` @@ -270901,20 +270901,20 @@ exports[`Locale Provider should display the text as si 1`] = ` @@ -271126,20 +271126,20 @@ exports[`Locale Provider should display the text as si 1`] = ` @@ -272197,20 +272197,20 @@ exports[`Locale Provider should display the text as si 1`] = ` @@ -276004,20 +276004,20 @@ exports[`Locale Provider should display the text as sk 1`] = ` @@ -276229,20 +276229,20 @@ exports[`Locale Provider should display the text as sk 1`] = ` @@ -277300,20 +277300,20 @@ exports[`Locale Provider should display the text as sk 1`] = ` @@ -281107,20 +281107,20 @@ exports[`Locale Provider should display the text as sl 1`] = ` @@ -281332,20 +281332,20 @@ exports[`Locale Provider should display the text as sl 1`] = ` @@ -282403,20 +282403,20 @@ exports[`Locale Provider should display the text as sl 1`] = ` @@ -286210,20 +286210,20 @@ exports[`Locale Provider should display the text as sr 1`] = ` @@ -286435,20 +286435,20 @@ exports[`Locale Provider should display the text as sr 1`] = ` @@ -287506,20 +287506,20 @@ exports[`Locale Provider should display the text as sr 1`] = ` @@ -291313,20 +291313,20 @@ exports[`Locale Provider should display the text as sv 1`] = ` @@ -291538,20 +291538,20 @@ exports[`Locale Provider should display the text as sv 1`] = ` @@ -292609,20 +292609,20 @@ exports[`Locale Provider should display the text as sv 1`] = ` @@ -296416,20 +296416,20 @@ exports[`Locale Provider should display the text as ta 1`] = ` @@ -296641,20 +296641,20 @@ exports[`Locale Provider should display the text as ta 1`] = ` @@ -297712,20 +297712,20 @@ exports[`Locale Provider should display the text as ta 1`] = ` @@ -301519,20 +301519,20 @@ exports[`Locale Provider should display the text as th 1`] = ` @@ -301744,20 +301744,20 @@ exports[`Locale Provider should display the text as th 1`] = ` @@ -302815,20 +302815,20 @@ exports[`Locale Provider should display the text as th 1`] = ` @@ -306622,20 +306622,20 @@ exports[`Locale Provider should display the text as tk 1`] = ` @@ -306847,20 +306847,20 @@ exports[`Locale Provider should display the text as tk 1`] = ` @@ -307918,20 +307918,20 @@ exports[`Locale Provider should display the text as tk 1`] = ` @@ -311725,20 +311725,20 @@ exports[`Locale Provider should display the text as tr 1`] = ` @@ -311950,20 +311950,20 @@ exports[`Locale Provider should display the text as tr 1`] = ` @@ -313021,20 +313021,20 @@ exports[`Locale Provider should display the text as tr 1`] = ` @@ -316828,20 +316828,20 @@ exports[`Locale Provider should display the text as uk 1`] = ` @@ -317053,20 +317053,20 @@ exports[`Locale Provider should display the text as uk 1`] = ` @@ -318124,20 +318124,20 @@ exports[`Locale Provider should display the text as uk 1`] = ` @@ -321931,20 +321931,20 @@ exports[`Locale Provider should display the text as ur 1`] = ` @@ -322156,20 +322156,20 @@ exports[`Locale Provider should display the text as ur 1`] = ` @@ -323227,20 +323227,20 @@ exports[`Locale Provider should display the text as ur 1`] = ` @@ -327034,20 +327034,20 @@ exports[`Locale Provider should display the text as vi 1`] = ` @@ -327259,20 +327259,20 @@ exports[`Locale Provider should display the text as vi 1`] = ` @@ -328330,20 +328330,20 @@ exports[`Locale Provider should display the text as vi 1`] = ` @@ -332137,20 +332137,20 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` @@ -332362,20 +332362,20 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` @@ -333433,20 +333433,20 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` @@ -337240,20 +337240,20 @@ exports[`Locale Provider should display the text as zh-hk 1`] = ` @@ -337465,20 +337465,20 @@ exports[`Locale Provider should display the text as zh-hk 1`] = ` @@ -338536,20 +338536,20 @@ exports[`Locale Provider should display the text as zh-hk 1`] = ` @@ -342343,20 +342343,20 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` @@ -342568,20 +342568,20 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` @@ -343639,20 +343639,20 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` diff --git a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap index 9d4c652dd0e5..bb1eabf05aa8 100644 --- a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -7652,20 +7652,20 @@ exports[`renders ./components/select/demo/status.tsx extend context correctly 1` @@ -7773,20 +7773,20 @@ exports[`renders ./components/select/demo/status.tsx extend context correctly 1` diff --git a/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap index 26817565e50d..abfaf9ab7103 100644 --- a/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -10349,20 +10349,20 @@ exports[`renders ./components/space/demo/compact-debug.tsx extend context correc diff --git a/components/table/__tests__/__snapshots__/Table.pagination.test.tsx.snap b/components/table/__tests__/__snapshots__/Table.pagination.test.tsx.snap index 7d84a7bb7f9d..cdbeeabbce5c 100644 --- a/components/table/__tests__/__snapshots__/Table.pagination.test.tsx.snap +++ b/components/table/__tests__/__snapshots__/Table.pagination.test.tsx.snap @@ -550,20 +550,20 @@ exports[`Table.pagination should not crash when trigger onChange in render 1`] = diff --git a/components/table/__tests__/__snapshots__/Table.test.tsx.snap b/components/table/__tests__/__snapshots__/Table.test.tsx.snap index 2a01b96e3a0c..e8f3ac45a7ea 100644 --- a/components/table/__tests__/__snapshots__/Table.test.tsx.snap +++ b/components/table/__tests__/__snapshots__/Table.test.tsx.snap @@ -167,20 +167,20 @@ exports[`Table rtl render component should be rendered correctly in RTL directio @@ -585,20 +585,20 @@ exports[`Table should render title 1`] = ` diff --git a/components/table/__tests__/__snapshots__/empty.test.tsx.snap b/components/table/__tests__/__snapshots__/empty.test.tsx.snap index 64f9c01e7e9f..c4e65bcf6358 100644 --- a/components/table/__tests__/__snapshots__/empty.test.tsx.snap +++ b/components/table/__tests__/__snapshots__/empty.test.tsx.snap @@ -99,20 +99,20 @@ exports[`Table renders empty table 1`] = ` @@ -462,20 +462,20 @@ exports[`Table renders empty table with fixed columns should work 1`] = ` @@ -623,20 +623,20 @@ exports[`Table renders empty table without emptyText when loading 1`] = ` diff --git a/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap index 5990fee854a8..aff05d154953 100644 --- a/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -278,20 +278,20 @@ exports[`renders ./components/transfer/demo/advanced.tsx extend context correctl @@ -653,20 +653,20 @@ exports[`renders ./components/transfer/demo/advanced.tsx extend context correctl @@ -1854,20 +1854,20 @@ exports[`renders ./components/transfer/demo/custom-item.tsx extend context corre @@ -2144,20 +2144,20 @@ exports[`renders ./components/transfer/demo/custom-item.tsx extend context corre @@ -3112,20 +3112,20 @@ Array [ @@ -3441,20 +3441,20 @@ Array [ @@ -4731,20 +4731,20 @@ exports[`renders ./components/transfer/demo/search.tsx extend context correctly @@ -5086,20 +5086,20 @@ exports[`renders ./components/transfer/demo/search.tsx extend context correctly @@ -5335,20 +5335,20 @@ exports[`renders ./components/transfer/demo/status.tsx extend context correctly @@ -5624,20 +5624,20 @@ exports[`renders ./components/transfer/demo/status.tsx extend context correctly @@ -5933,20 +5933,20 @@ exports[`renders ./components/transfer/demo/status.tsx extend context correctly @@ -6288,20 +6288,20 @@ exports[`renders ./components/transfer/demo/status.tsx extend context correctly @@ -8094,20 +8094,20 @@ exports[`renders ./components/transfer/demo/tree-transfer.tsx extend context cor diff --git a/components/transfer/__tests__/__snapshots__/demo.test.ts.snap b/components/transfer/__tests__/__snapshots__/demo.test.ts.snap index 4253967781fb..fa489a56aba8 100644 --- a/components/transfer/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/transfer/__tests__/__snapshots__/demo.test.ts.snap @@ -149,20 +149,20 @@ exports[`renders ./components/transfer/demo/advanced.tsx correctly 1`] = ` @@ -395,20 +395,20 @@ exports[`renders ./components/transfer/demo/advanced.tsx correctly 1`] = ` @@ -1209,20 +1209,20 @@ exports[`renders ./components/transfer/demo/custom-item.tsx correctly 1`] = ` @@ -1370,20 +1370,20 @@ exports[`renders ./components/transfer/demo/custom-item.tsx correctly 1`] = ` @@ -1896,20 +1896,20 @@ Array [ @@ -2041,20 +2041,20 @@ Array [ @@ -2999,20 +2999,20 @@ exports[`renders ./components/transfer/demo/search.tsx correctly 1`] = ` @@ -3225,20 +3225,20 @@ exports[`renders ./components/transfer/demo/search.tsx correctly 1`] = ` @@ -3345,20 +3345,20 @@ exports[`renders ./components/transfer/demo/status.tsx correctly 1`] = ` @@ -3505,20 +3505,20 @@ exports[`renders ./components/transfer/demo/status.tsx correctly 1`] = ` @@ -3685,20 +3685,20 @@ exports[`renders ./components/transfer/demo/status.tsx correctly 1`] = ` @@ -3911,20 +3911,20 @@ exports[`renders ./components/transfer/demo/status.tsx correctly 1`] = ` @@ -5459,20 +5459,20 @@ exports[`renders ./components/transfer/demo/tree-transfer.tsx correctly 1`] = ` diff --git a/components/transfer/__tests__/__snapshots__/index.test.tsx.snap b/components/transfer/__tests__/__snapshots__/index.test.tsx.snap index a703e8773578..f1e4c6d60f3c 100644 --- a/components/transfer/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/transfer/__tests__/__snapshots__/index.test.tsx.snap @@ -81,20 +81,20 @@ exports[`Transfer rtl render component should be rendered correctly in RTL direc @@ -240,20 +240,20 @@ exports[`Transfer rtl render component should be rendered correctly in RTL direc @@ -1003,20 +1003,20 @@ exports[`Transfer should support render value and label in item 1`] = ` @@ -1252,20 +1252,20 @@ exports[`immutable data dataSource is frozen 1`] = ` diff --git a/components/tree-select/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/tree-select/__tests__/__snapshots__/demo-extend.test.ts.snap index 62991b3b7294..c996c79afe4b 100644 --- a/components/tree-select/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/tree-select/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1826,20 +1826,20 @@ exports[`renders ./components/tree-select/demo/status.tsx extend context correct @@ -1962,20 +1962,20 @@ exports[`renders ./components/tree-select/demo/status.tsx extend context correct From a1e14f61650fc74f2210967c22eb6bb5f79f936f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Mon, 21 Nov 2022 17:27:06 +0800 Subject: [PATCH 008/252] docs: guide about where config (#38764) * docs: guide about where config * docs: add diff demo * docs: Add SSR part * docs: add faq --- docs/react/customize-theme.en-US.md | 75 ++++++++++++++++++++++++++--- docs/react/customize-theme.zh-CN.md | 61 +++++++++++++++++++++++ docs/react/faq.en-US.md | 8 +++ docs/react/faq.zh-CN.md | 8 +++ 4 files changed, 145 insertions(+), 7 deletions(-) diff --git a/docs/react/customize-theme.en-US.md b/docs/react/customize-theme.en-US.md index a3a47761b55c..96d403f8a4ee 100644 --- a/docs/react/customize-theme.en-US.md +++ b/docs/react/customize-theme.en-US.md @@ -215,11 +215,72 @@ const theme = { }; ``` +### Compatible adjustment + +Ant Design default using CSS-in-JS with `:where` Selector to reduce priority. If you want to support old browser, you can use `@ant-design/cssinjs` to adjust this behavior (Please note keep version align with antd): + +```tsx +import React from 'react'; +import { StyleProvider } from '@ant-design/cssinjs'; + +export default () => ( + + + +); +``` + +It will turn `:where` to class selector: + +```diff +-- :where(.css-bAMboO).ant-btn { +++ .css-bAMboO.ant-btn { + color: #fff; + } +``` + +### Server Side Render (SSR) + +Use `@ant-design/cssinjs` to extract style: + +```tsx +import React from 'react'; +import { renderToString } from 'react-dom/server'; +import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs'; + +export default () => { + // SSR Render + const cache = createCache(); + + const html = renderToString( + + + , + ); + + // Grab style from cache + const styleText = extractStyle(cache); + + // Mix with style + return ` + + + + ${styleText} + + +
${html}
+ + +`; +}; +``` + ## API ### Theme -| 属性 | 说明 | 类型 | 默认值 | +| Property | Description | Type | Default | | --- | --- | --- | --- | | token | Modify Design Token | `AliasToken` | - | | inherit | Inherit theme configured in upper ConfigProvider | boolean | true | @@ -228,13 +289,13 @@ const theme = { ### OverrideToken -| 属性 | 说明 | 类型 | 默认值 | +| Property | Description | Type | Default | | --- | --- | --- | --- | | `Component` (可以是任意 antd 组件名,如 `Button`) | 用于修改 Component Token 以及覆盖该组件消费的 Alias Token | `ComponentToken & AliasToken` | - | ### SeedToken -| 属性 | 说明 | 类型 | 默认值 | +| Property | Description | Type | Default | | --- | --- | --- | --- | | colorPrimary | 品牌主色 | `string` | `#1677ff` | | colorSuccess | 成功色 | `string` | `#52c41a` | @@ -271,9 +332,9 @@ const theme = { ### MapToken -> 继承所有 SeedToken 的属性 +> 继承所有 SeedToken 的 Property -| 属性 | 说明 | 类型 | 默认值 | +| Property | Description | Type | Default | | --- | --- | --- | --- | | colorText | 一级文本色 | `string` | `rgba(0, 0, 0, 0.88)` | | colorTextSecondary | 二级文本色 | `string` | `rgba(0, 0, 0, 0.65)` | @@ -364,9 +425,9 @@ const theme = { ### AliasToken -> 继承所有 SeedToken 和 MapToken 的属性 +> 继承所有 SeedToken 和 MapToken 的 Property -| 属性 | 说明 | 类型 | 默认值 | +| Property | Description | Type | Default | | --- | --- | --- | --- | | colorFillContent | - | `string` | `rgba(0, 0, 0, 0.06)` | | colorFillContentHover | - | `string` | `rgba(0, 0, 0, 0.12)` | diff --git a/docs/react/customize-theme.zh-CN.md b/docs/react/customize-theme.zh-CN.md index 2db906323e58..ab51415c9a0c 100644 --- a/docs/react/customize-theme.zh-CN.md +++ b/docs/react/customize-theme.zh-CN.md @@ -215,6 +215,67 @@ const theme = { }; ``` +### 兼容性调整 + +Ant Design 的 CSS-in-JS 默认通过 `:where` 选择器降低 CSS Selector 优先级。在某些场景下你如果需要支持的旧版游览器,你可以使用 `@ant-design/cssinjs` 取消默认的降权操作(请注意版本保持与 antd 一致): + +```tsx +import React from 'react'; +import { StyleProvider } from '@ant-design/cssinjs'; + +export default () => ( + + + +); +``` + +切换后,样式将从 `:where` 切换为类选择器: + +```diff +-- :where(.css-bAMboO).ant-btn { +++ .css-bAMboO.ant-btn { + color: #fff; + } +``` + +### 服务端渲染 + +使用 `@ant-design/cssinjs` 将所需样式抽离: + +```tsx +import React from 'react'; +import { renderToString } from 'react-dom/server'; +import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs'; + +export default () => { + // SSR Render + const cache = createCache(); + + const html = renderToString( + + + , + ); + + // Grab style from cache + const styleText = extractStyle(cache); + + // Mix with style + return ` + + + + ${styleText} + + +
${html}
+ + +`; +}; +``` + ## API ### Theme diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md index 9d323be4c4a8..3d45674f994f 100644 --- a/docs/react/faq.en-US.md +++ b/docs/react/faq.en-US.md @@ -183,6 +183,14 @@ You should only access the API by official doc with ref. Directly access interna For historical reasons, the display names of the pop components are not uniform, and both `open` and `visible` are used. This makes the memory cost that non-tsx users encounter when developing. It also leads to ambiguity about what name to choose when adding a feature. So we want to unify the attribute name, you can still use the original `visible` and it will still be backward compatible, but we will remove this attribute from the documentation as of v5. +## Dynamic style using `:where` selector which not support old browser. + +Please ref dynamic theme document [Compatible Adjustment](/docs/react/customize-theme#compatible-adjustment) part. + +## How to support SSR? + +Please ref dynamic theme document [SSR](/docs/react/customize-theme#server-side-render-ssr) part. + ## How to spell Ant Design correctly? - ✅ **Ant Design**: Capitalized with space, for the design language. diff --git a/docs/react/faq.zh-CN.md b/docs/react/faq.zh-CN.md index 7d07d57fc64b..cf4e436d5202 100644 --- a/docs/react/faq.zh-CN.md +++ b/docs/react/faq.zh-CN.md @@ -204,6 +204,14 @@ ConfigProvider.config({ 因为历史原因,弹层类组件展示命名并不统一,出现了 `open` 与 `visible` 都在使用的情况。这使得非 tsx 用户在开发时遭遇的记忆成本。同样导致新增 feature 时选择何种命名的模棱两可。因而我们希望统一该属性命名,你仍然可以使用原本的 `visible` 它仍然会向下兼容,但是从 v5 起我们将从文档中移除该属性。 +## 动态样式有 `:where` 导致旧版游览器不支持怎么办? + +请参考动态主题文档 [兼容性调整](/docs/react/customize-theme-cn#兼容性调整) 部分内容。 + +## 如何支持 SSR? + +请参考动态主题文档 [服务端渲染](/docs/react/customize-theme-cn#服务端渲染) 部分内容。 + ## 如何正确的拼写 Ant Design? - ✅ **Ant Design**:用空格分隔的首字母大写单词,指代设计语言。 From 59772e9222f5392531d06abf8125cb32c172ee3d Mon Sep 17 00:00:00 2001 From: zqran Date: Mon, 21 Nov 2022 17:39:46 +0800 Subject: [PATCH 009/252] docs: update document Table style (#38727) * docs: update document Table style * docs: add className for component API table * docs: optimize rehypeAntd logic --- .dumi/rehypeAntd.ts | 14 +- .dumi/theme/common/GlobalStyles.tsx | 538 ++++++++++++++-------------- 2 files changed, 286 insertions(+), 266 deletions(-) diff --git a/.dumi/rehypeAntd.ts b/.dumi/rehypeAntd.ts index a05398fafc20..29e832063098 100644 --- a/.dumi/rehypeAntd.ts +++ b/.dumi/rehypeAntd.ts @@ -6,6 +6,8 @@ import { type HastRoot, type UnifiedTransformer, unistUtilVisit } from 'dumi'; */ function rehypeAntd(): UnifiedTransformer { return (tree, vFile) => { + const filename = (vFile.data.frontmatter as any).filename; + unistUtilVisit.visit(tree, 'element', (node) => { if (node.tagName === 'DumiDemoGrid') { // replace DumiDemoGrid to DemoWrapper, to implement demo toolbar @@ -16,9 +18,7 @@ function rehypeAntd(): UnifiedTransformer { assert( contentNode.type === 'text', - `ResourceCards content must be plain text!\nat ${ - (vFile.data.frontmatter as any).filename - }`, + `ResourceCards content must be plain text!\nat ${filename}`, ); // clear children @@ -52,6 +52,14 @@ function rehypeAntd(): UnifiedTransformer { ), }, ]; + } else if ( + node.type === 'element' && + node.tagName === 'Table' && + /^components/.test(filename) + ) { + if (!node.properties) return; + node.properties.className ??= []; + (node.properties.className as string[]).push('component-api-table'); } }); }; diff --git a/.dumi/theme/common/GlobalStyles.tsx b/.dumi/theme/common/GlobalStyles.tsx index 07ee8e395139..6321d7d14787 100644 --- a/.dumi/theme/common/GlobalStyles.tsx +++ b/.dumi/theme/common/GlobalStyles.tsx @@ -406,8 +406,50 @@ const GlobalStyles = () => { } .markdown .dumi-default-table { - table { + .component-api-table { display: block; + + td { + &:first-child { + width: 18%; + color: #595959; + font-weight: 600; + white-space: nowrap; + } + + &:nth-child(2) { + width: 55%; + } + + &:nth-child(3) { + width: 22%; + color: ${token['magenta-7']}; + font-size: ${Math.max(token.fontSize - 1, 12)}px; + } + + &:nth-child(4) { + width: 15%; + font-size: ${Math.max(token.fontSize - 1, 12)}px; + } + + &:nth-child(5) { + width: 8%; + font-size: ${Math.max(token.fontSize - 1, 12)}px; + } + + &:nth-last-child(3):first-child { + width: 38%; + } + + &:nth-last-child(3):first-child ~ td:nth-last-child(2) { + width: 70%; + } + } + } + } + + .markdown .dumi-default-table { + table { margin: 2em 0; overflow-x: auto; overflow-y: hidden; @@ -447,38 +489,7 @@ const GlobalStyles = () => { td { &:first-child { - width: 18%; - color: #595959; - font-weight: 600; - white-space: nowrap; - } - - &:nth-child(2) { - width: 55%; - } - - &:nth-child(3) { - width: 22%; - color: ${token['magenta-7']}; - font-size: ${Math.max(token.fontSize - 1, 12)}px; - } - - &:nth-child(4) { - width: 15%; - font-size: ${Math.max(token.fontSize - 1, 12)}px; - } - - &:nth-child(5) { - width: 8%; - font-size: ${Math.max(token.fontSize - 1, 12)}px; - } - - &:nth-last-child(3):first-child { - width: 38%; - } - - &:nth-last-child(3):first-child ~ td:nth-last-child(2) { - width: 70%; + min-width: 58px; } } } @@ -1769,236 +1780,237 @@ const GlobalStyles = () => { {/* Preview Image */} From f11d628be6b3e8d594fd9acc66c950d3a258a238 Mon Sep 17 00:00:00 2001 From: HzLin <52577448+Hazel-Lin@users.noreply.github.com> Date: Mon, 21 Nov 2022 18:18:04 +0800 Subject: [PATCH 010/252] docs(Badge): change file name (#38801) --- .../badge/__tests__/__snapshots__/demo-extend.test.ts.snap | 2 +- components/badge/__tests__/__snapshots__/demo.test.ts.snap | 2 +- components/badge/demo/{ribbbon.tsx => ribbon.tsx} | 0 components/badge/index.en-US.md | 2 +- components/badge/index.zh-CN.md | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename components/badge/demo/{ribbbon.tsx => ribbon.tsx} (100%) diff --git a/components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap index 6c09459b7d34..35b3f831a19a 100644 --- a/components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1727,7 +1727,7 @@ exports[`renders ./components/badge/demo/overflow.tsx extend context correctly 1 `; -exports[`renders ./components/badge/demo/ribbbon.tsx extend context correctly 1`] = ` +exports[`renders ./components/badge/demo/ribbon.tsx extend context correctly 1`] = `
`; -exports[`renders ./components/badge/demo/ribbbon.tsx correctly 1`] = ` +exports[`renders ./components/badge/demo/ribbon.tsx correctly 1`] = `
Size Status Colorful Badge -Ribbon +Ribbon Ribbon Debug Mixed usage Title diff --git a/components/badge/index.zh-CN.md b/components/badge/index.zh-CN.md index 7245fc6c251b..9acc1d97239c 100644 --- a/components/badge/index.zh-CN.md +++ b/components/badge/index.zh-CN.md @@ -27,7 +27,7 @@ group: 数据展示 大小 状态点 多彩徽标 -缎带 +缎带 Ribbon Debug 各种混用的情况 自定义标题 From c7a1074dc2af989b318cdb008d5ed822592fce90 Mon Sep 17 00:00:00 2001 From: isaced Date: Mon, 21 Nov 2022 22:16:01 +0800 Subject: [PATCH 011/252] docs(Tabs): fix markdown format (#38810) --- components/tabs/index.en-US.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/tabs/index.en-US.md b/components/tabs/index.en-US.md index 19ff6464ed77..05114e1cd6d3 100644 --- a/components/tabs/index.en-US.md +++ b/components/tabs/index.en-US.md @@ -64,14 +64,14 @@ return ; ### Tabs | Property | Description | Type | Default | Version | -| --- | --- | --- | --- | --- | --- | +| --- | --- | --- | --- | --- | | activeKey | Current TabPane's key | string | - | | | addIcon | Customize add icon | ReactNode | - | 4.4.0 | | animated | Whether to change tabs with animation. Only works while `tabPosition="top"` | boolean \| { inkBar: boolean, tabPane: boolean } | { inkBar: true, tabPane: false } | | | centered | Centers tabs | boolean | false | 4.4.0 | | defaultActiveKey | Initial active TabPane's key, if `activeKey` is not set | string | - | | | hideAdd | Hide plus icon or not. Only works while `type="editable-card"` | boolean | false | | -| items | Configure tab content | [TabItem](#TabItem) | [] | 4.23.0 | +| items | Configure tab content | [TabItemType](#TabItemType) | [] | 4.23.0 | | moreIcon | The custom icon of ellipsis | ReactNode | <EllipsisOutlined /> | 4.14.0 | | popupClassName | `className` for more dropdown. | string | - | 4.21.0 | | renderTabBar | Replace the TabBar | (props: DefaultTabBarProps, DefaultTabBar: React.ComponentClass) => React.ReactElement | - | | @@ -86,7 +86,6 @@ return ; | onEdit | Callback executed when tab is added or removed. Only works while `type="editable-card"` | (action === 'add' ? event : targetKey, action): void | - | | | onTabClick | Callback executed when tab is clicked | function(key: string, event: MouseEvent) | - | | | onTabScroll | Trigger when tab scroll | function({ direction: `left` \| `right` \| `top` \| `bottom` }) | - | 4.3.0 | -| items | TabItem content | [TabItemType](#TabItemType) | [] | 4.23.0 | More option at [rc-tabs tabs](https://github.com/react-component/tabs#tabs) From c3fa08c8962c7c668c0188f5ffc1440c9ce2474e Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 21 Nov 2022 22:18:30 +0800 Subject: [PATCH 012/252] docs: remove releasly url (#38815) --- docs/react/introduce.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react/introduce.zh-CN.md b/docs/react/introduce.zh-CN.md index 8cf957d17bc3..dc39f61d697a 100644 --- a/docs/react/introduce.zh-CN.md +++ b/docs/react/introduce.zh-CN.md @@ -52,7 +52,7 @@ title: Ant Design of React - 稳定版:[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) -你可以订阅:https://github.com/ant-design/ant-design/releases.atom 或 https://app.releasly.co/sites/ant-design/ant-design 来获得版本发布的通知。 +你可以订阅:https://github.com/ant-design/ant-design/releases.atom 来获得版本发布的通知。 ## 安装 From b87b956e4b985bed8bcb2a04bed9702d267ccbad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Mon, 21 Nov 2022 22:33:47 +0800 Subject: [PATCH 013/252] docs: Update v5 res & adjust cssinjs doc (#38799) * docs: update res * docs: more * docs: update * Update docs/react/customize-theme.zh-CN.md Co-authored-by: afc163 * docs: more mig Co-authored-by: afc163 --- docs/react/customize-theme.en-US.md | 4 +++- docs/react/customize-theme.zh-CN.md | 4 +++- docs/react/migration-v5.en-US.md | 21 ++++++++++++++++++ docs/react/migration-v5.zh-CN.md | 34 ++++++++++++++++++++--------- docs/resources.en-US.md | 7 +----- docs/resources.zh-CN.md | 7 +----- 6 files changed, 53 insertions(+), 24 deletions(-) diff --git a/docs/react/customize-theme.en-US.md b/docs/react/customize-theme.en-US.md index 96d403f8a4ee..765aadd14cd1 100644 --- a/docs/react/customize-theme.en-US.md +++ b/docs/react/customize-theme.en-US.md @@ -217,7 +217,7 @@ const theme = { ### Compatible adjustment -Ant Design default using CSS-in-JS with `:where` Selector to reduce priority. If you want to support old browser, you can use `@ant-design/cssinjs` to adjust this behavior (Please note keep version align with antd): +Ant Design default using CSS-in-JS with `:where` Selector to reduce priority to avoid user additional adjust style cost when updating to v5. If you want to support old browser, you can use `@ant-design/cssinjs` to adjust this behavior (Please note keep version align with antd): ```tsx import React from 'react'; @@ -239,6 +239,8 @@ It will turn `:where` to class selector: } ``` +Note: After turning off the `:where` downgrade, you may need to manually adjust the priority of some styles. + ### Server Side Render (SSR) Use `@ant-design/cssinjs` to extract style: diff --git a/docs/react/customize-theme.zh-CN.md b/docs/react/customize-theme.zh-CN.md index ab51415c9a0c..451ac9ecc361 100644 --- a/docs/react/customize-theme.zh-CN.md +++ b/docs/react/customize-theme.zh-CN.md @@ -217,7 +217,7 @@ const theme = { ### 兼容性调整 -Ant Design 的 CSS-in-JS 默认通过 `:where` 选择器降低 CSS Selector 优先级。在某些场景下你如果需要支持的旧版游览器,你可以使用 `@ant-design/cssinjs` 取消默认的降权操作(请注意版本保持与 antd 一致): +Ant Design 的 CSS-in-JS 默认通过 `:where` 选择器降低 CSS Selector 优先级,以减少用户升级 v5 时额外调整自定义样式成本。在某些场景下你如果需要支持的旧版浏览器,你可以使用 `@ant-design/cssinjs` 取消默认的降权操作(请注意版本保持与 antd 一致): ```tsx import React from 'react'; @@ -239,6 +239,8 @@ export default () => ( } ``` +注意:关闭 `:where` 降权后,你可能需要手动调整一些样式的优先级。 + ### 服务端渲染 使用 `@ant-design/cssinjs` 将所需样式抽离: diff --git a/docs/react/migration-v5.en-US.md b/docs/react/migration-v5.en-US.md index 9d0afa280266..8fc7697f5b39 100644 --- a/docs/react/migration-v5.en-US.md +++ b/docs/react/migration-v5.en-US.md @@ -185,6 +185,27 @@ const v4Token = convertLegacyToken(mapToken); } ``` +### Remove babel-plugin-import + +Remove `babel-plugin-import` from package.json and modify `.babelrc`: + +```diff +"plugins": [ +- ["import", { "libraryName": "antd", "libraryDirectory": "lib"}, "antd"], +] +``` + +Umi user can disable by config: + +```diff +// config/config.ts or .umirc +export default { + antd: { +- import: true, + }, +}; +``` + ## Encounter problems If you encounter problems during the upgrade, please go to [GitHub issues](https://new-issue.ant.design/) for feedback. We will respond and improve this document as soon as possible. diff --git a/docs/react/migration-v5.zh-CN.md b/docs/react/migration-v5.zh-CN.md index 6f71de5dcd06..c2a1d7d7d1e6 100644 --- a/docs/react/migration-v5.zh-CN.md +++ b/docs/react/migration-v5.zh-CN.md @@ -27,16 +27,7 @@ title: 从 v4 到 v5 - 移除 css variables 以及在此之上构筑的动态主题方案。 - 移除 `lib` 产物,只提供 `dist` 和 `es` 产物,原本的 `antd/es/locale` 目录也已经移除,语言包可到 `antd/locale` 目录下寻找。 - 内置的时间库使用 Dayjs 替代 Moment.js,具体请查看 [使用自定义日期库](/docs/react/use-custom-date-library-cn/)。 -- 不再支持 `babel-plugin-import`,CSS-in-JS 本身具有按需加载的能力,不再需要插件支持。Umi 用户可以移除相关配置。 - - ```diff - // config/config.ts - export default { - antd: { - - import: true, - }, - }; - ``` +- 不再支持 `babel-plugin-import`,CSS-in-JS 本身具有按需加载的能力,不再需要插件支持。 ### 兼容性调整 @@ -164,6 +155,8 @@ title: 从 v4 到 v5 npm install --save antd@5.x ``` +### less 迁移 + 如果你使用到了 antd 的 less 变量,通过兼容包将 v5 变量转译成 v4 版本,并通过 less-loader 注入: ```jsx @@ -186,6 +179,27 @@ const v4Token = convertLegacyToken(mapToken); } ``` +### 移除 babel-plugin-import + +从 package.json 中移除 `babel-plugin-import`,并从 `.babelrc` 移除该插件: + +```diff +"plugins": [ +- ["import", { "libraryName": "antd", "libraryDirectory": "lib"}, "antd"], +] +``` + +Umi 用户可以在配置文件中关闭: + +```diff +// config/config.ts or .umirc +export default { + antd: { +- import: true, + }, +}; +``` + ## 遇到问题 如果您在升级过程中遇到了问题,请到 [GitHub issues](https://new-issue.ant.design/) 进行反馈。我们会尽快响应和相应改进这篇文档。 diff --git a/docs/resources.en-US.md b/docs/resources.en-US.md index 453f73016bdb..7adb73bb0837 100644 --- a/docs/resources.en-US.md +++ b/docs/resources.en-US.md @@ -15,12 +15,7 @@ Please find below some of the design resources and tools about Ant Design that w - Sketch Symbols - https://gw.alipayobjects.com/zos/basement_prod/048ee28f-2c80-4d15-9aa3-4f5ddac50465.svg - Sketch Symbols for Desktop - - https://gw.alipayobjects.com/os/bmw-prod/a5ff1d86-44cd-4b86-92f8-daab59cba5b7.sketch - - Official -- Sketch Symbols (Dark) - - https://gw.alipayobjects.com/zos/basement_prod/048ee28f-2c80-4d15-9aa3-4f5ddac50465.svg - - Sketch Symbols for Desktop with dark theme - - https://gw.alipayobjects.com/os/bmw-prod/6b670a1c-26e3-4379-9c86-7a2b95e170e5.sketch + - https://gw.alipayobjects.com/os/hitu-asset/5217de80-7a3e-413f-809e-20ecede4f3f3/hitu-1669000735416-5000001.sketch - Official - Mobile Components - https://gw.alipayobjects.com/zos/basement_prod/c0c3852c-d245-4330-886b-cb02ef49eb6d.svg diff --git a/docs/resources.zh-CN.md b/docs/resources.zh-CN.md index 0d350dd6bb41..62cd00f11f09 100644 --- a/docs/resources.zh-CN.md +++ b/docs/resources.zh-CN.md @@ -15,12 +15,7 @@ toc: false - Sketch 组件包 - https://gw.alipayobjects.com/zos/basement_prod/048ee28f-2c80-4d15-9aa3-4f5ddac50465.svg - 桌面组件 Sketch 模板包 - - https://gw.alipayobjects.com/os/bmw-prod/82c08c51-9993-4568-90c1-249c8301c0af.sketch - - 官方 -- Sketch 组件包 (暗色) - - https://gw.alipayobjects.com/zos/basement_prod/048ee28f-2c80-4d15-9aa3-4f5ddac50465.svg - - 桌面组件 Sketch 模板包,内含暗色版本的 antd 组件 - - https://gw.alipayobjects.com/os/bmw-prod/f002145c-33d9-408e-ba75-a1a68896dfa3.sketch + - https://gw.alipayobjects.com/os/hitu-asset/5217de80-7a3e-413f-809e-20ecede4f3f3/hitu-1669000735416-5000001.sketch - 官方 - Mobile Components - https://gw.alipayobjects.com/zos/basement_prod/c0c3852c-d245-4330-886b-cb02ef49eb6d.svg From 882b8740b12f48a686fba18b31da534945eb1b16 Mon Sep 17 00:00:00 2001 From: Greedy1997 <37686027+Greedy1997@users.noreply.github.com> Date: Mon, 21 Nov 2022 22:43:04 +0800 Subject: [PATCH 014/252] docs: improve icon copied style (#38809) Fixed the click text display issue --- .dumi/theme/common/GlobalStyles.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dumi/theme/common/GlobalStyles.tsx b/.dumi/theme/common/GlobalStyles.tsx index 6321d7d14787..4ab839c53416 100644 --- a/.dumi/theme/common/GlobalStyles.tsx +++ b/.dumi/theme/common/GlobalStyles.tsx @@ -1280,6 +1280,7 @@ const GlobalStyles = () => { width: 100%; height: 100%; color: #fff; + background: #1677ff; line-height: 110px; text-align: center; opacity: 0; @@ -1288,7 +1289,6 @@ const GlobalStyles = () => { } &.copied::after { - top: -10px; opacity: 1; } } From 3040ed7566e56ce5d79a33664fa01168c6f612a4 Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Mon, 21 Nov 2022 23:18:50 +0800 Subject: [PATCH 015/252] site: fix site style (#38819) --- .dumi/pages/index/components/Banner.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/.dumi/pages/index/components/Banner.tsx b/.dumi/pages/index/components/Banner.tsx index 672e50865c60..1bbfe315853e 100644 --- a/.dumi/pages/index/components/Banner.tsx +++ b/.dumi/pages/index/components/Banner.tsx @@ -71,6 +71,7 @@ export default function Banner({ children }: BannerProps) { backgroundRepeat: 'repeat-x', backgroundPosition: '0 0', backgroundSize: 'auto 100%', + marginLeft: -1, }} />
From b9cab0fa2e3ce34ae41449accd625670c4a943e7 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: Tue, 22 Nov 2022 11:40:17 +0800 Subject: [PATCH 016/252] chore: add FormItemInputContext for v3 compatible usage --- components/form/hooks/useFormItemStatus.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/form/hooks/useFormItemStatus.ts b/components/form/hooks/useFormItemStatus.ts index e05dc3270e3c..9c6624500301 100644 --- a/components/form/hooks/useFormItemStatus.ts +++ b/components/form/hooks/useFormItemStatus.ts @@ -19,4 +19,7 @@ const useFormItemStatus: UseFormItemStatus = () => { return { status }; }; +// Only used for compatible package. Not promise this will work on future version. +(useFormItemStatus as any).Context = FormItemInputContext; + export default useFormItemStatus; From 870080bfd01c2d4b94ac265b8dad5db10ece3119 Mon Sep 17 00:00:00 2001 From: Sheralijon Date: Tue, 22 Nov 2022 12:28:31 +0500 Subject: [PATCH 017/252] fix: expand icon row-indentation issue (#38823) --- components/table/style/expand.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/table/style/expand.tsx b/components/table/style/expand.tsx index 11d7e4f16807..c38d6505ea5d 100644 --- a/components/table/style/expand.tsx +++ b/components/table/style/expand.tsx @@ -48,6 +48,7 @@ const genExpandStyle: GenerateStyle = (token) => { [`${componentCls}-row-indent`]: { height: 1, + float: 'left', }, [`${componentCls}-row-expand-icon`]: { From b22ab1a83c8b3f65b5cffad755680313c00b8813 Mon Sep 17 00:00:00 2001 From: Chuns Chen Date: Tue, 22 Nov 2022 16:21:37 +0800 Subject: [PATCH 018/252] chore: revert compile with lib (#38832) * chore: revert compile with lib * chore: lib dekko test * fix: filename has spaces * chore: bump @ant-design/tools --- .antd-tools.config.js | 18 +++++------- .github/workflows/test.yml | 11 ++++++- package.json | 9 +++--- tests/dekko/lib.test.js | 60 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 15 deletions(-) create mode 100644 tests/dekko/lib.test.js diff --git a/.antd-tools.config.js b/.antd-tools.config.js index 5c139e9d30fc..deb1c0406387 100644 --- a/.antd-tools.config.js +++ b/.antd-tools.config.js @@ -1,23 +1,21 @@ const fs = require('fs'); const path = require('path'); +const restCssPath = path.join(process.cwd(), 'components', 'style', 'reset.css'); + function finalizeCompile() { if (fs.existsSync(path.join(__dirname, './es'))) { - // Build less entry file: dist/antd.less - fs.copyFileSync( - path.join(process.cwd(), 'components', 'style', 'reset.css'), - path.join(process.cwd(), 'es', 'style', 'reset.css'), - ); + fs.copyFileSync(restCssPath, path.join(process.cwd(), 'es', 'style', 'reset.css')); + } + + if (fs.existsSync(path.join(__dirname, './lib'))) { + fs.copyFileSync(restCssPath, path.join(process.cwd(), 'lib', 'style', 'reset.css')); } } function finalizeDist() { if (fs.existsSync(path.join(__dirname, './dist'))) { - // Build less entry file: dist/antd.less - fs.copyFileSync( - path.join(process.cwd(), 'components', 'style', 'reset.css'), - path.join(process.cwd(), 'dist', 'reset.css'), - ); + fs.copyFileSync(restCssPath, path.join(process.cwd(), 'dist', 'reset.css')); } } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d52252668991..53d87f61fd48 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -250,6 +250,12 @@ jobs: path: node_modules key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} + - name: cache lib + uses: actions/cache@v3 + with: + path: lib + key: lib-${{ github.sha }} + - name: cache es uses: actions/cache@v3 with: @@ -258,6 +264,9 @@ jobs: - name: compile run: npm run compile + + - name: check + run: node ./tests/dekko/lib.test.js needs: setup compiled-module-test: @@ -266,7 +275,7 @@ jobs: strategy: matrix: react: ['16', '17', '18'] - module: [es] + module: [lib, es] shard: ['1/2', '2/2'] env: REACT: ${{ matrix.react }} diff --git a/package.json b/package.json index 3310ddec3f27..b57abb003d62 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,13 @@ "files": [ "dist", "es", + "lib", "locale" ], "sideEffects": [ "*.less" ], - "main": "dist/antd.js", + "main": "lib/index.js", "module": "es/index.js", "unpkg": "dist/antd.min.js", "typings": "es/index.d.ts", @@ -59,7 +60,7 @@ "pretest": "npm run version", "predist": "npm run version", "presite": "npm run version && npm run collect-token-statistic", - "compile": "npm run clean && antd-tools run compile-experimental", + "compile": "npm run clean && antd-tools run compile", "changelog": "node ./scripts/print-changelog", "predeploy": "antd-tools run clean && npm run site && cp CNAME _site && npm run site:test", "deploy": "gh-pages -d _site -b gh-pages -f", @@ -77,7 +78,7 @@ "lint:script": "eslint . --ext .js,.jsx,.ts,.tsx", "pre-publish": "npm run test-all -- --skip-build", "prettier": "prettier -c --write **/*", - "pub": "npm run version && npm run collect-token-statistic && antd-tools run pub-experimental", + "pub": "npm run version && npm run collect-token-statistic && antd-tools run pub", "rome:format": "rome format --write .", "prepublishOnly": "antd-tools run guard", "postpublish": "node ./scripts/post-script.js", @@ -157,7 +158,7 @@ "devDependencies": { "@ant-design/bisheng-plugin": "^3.3.0-alpha.4", "@ant-design/hitu": "^0.0.0-alpha.13", - "@ant-design/tools": "^16.0.0-alpha.3", + "@ant-design/tools": "^16.1.0-alpha.2", "@docsearch/css": "^3.0.0", "@emotion/babel-preset-css-prop": "^11.10.0", "@emotion/css": "^11.10.5", diff --git a/tests/dekko/lib.test.js b/tests/dekko/lib.test.js new file mode 100644 index 000000000000..73c626f124f4 --- /dev/null +++ b/tests/dekko/lib.test.js @@ -0,0 +1,60 @@ +const $ = require('dekko'); +const chalk = require('chalk'); +const path = require('path'); + +function getFileName(filePath) { + return filePath.slice(filePath.lastIndexOf(path.sep) + 1); +} + +$('lib').isDirectory().hasFile('index.js').hasFile('index.d.ts'); + +$('lib/*') + .filter( + (filename) => + !filename.endsWith('index.js') && + !filename.endsWith('index.d.ts') && + !filename.endsWith('.map'), + ) + .isDirectory() + .filter( + (filename) => + !filename.endsWith('style') && !filename.endsWith('_util') && !filename.endsWith('locale'), + ) + .hasFile('index.js') + .hasFile('index.d.ts'); + +// locale + +const filterLocaleFile = (filePath) => { + const fileName = getFileName(filePath); + return ( + !fileName.endsWith('index.js') && + !fileName.endsWith('.d.ts') && + !fileName.endsWith('.map') && + !fileName.endsWith('style') && + !fileName.includes('-') && + !fileName.endsWith('LocaleReceiver.js') && + !fileName.endsWith('context.js') + ); +}; +const localeFiles = $('lib/locale/*').filter(filterLocaleFile); +const localeProviderFiles = $('lib/locale-provider/*').filter(filterLocaleFile); + +function compare(originFiles, targetFiles, targetPath) { + originFiles.assert( + `not exist in '${targetPath}'. Please use 'scripts/generateLegacyLocale.js' to refresh locale files.`, + (filePath) => { + const fileName = getFileName(filePath); + + return targetFiles.filenames.some( + (targetFilePath) => getFileName(targetFilePath) === fileName, + ); + }, + ); +} + +compare(localeFiles, localeProviderFiles, '/locale-provider'); +compare(localeProviderFiles, localeFiles, '/locale'); + +// eslint-disable-next-line no-console +console.log(chalk.green('✨ `lib` directory is valid.')); From 5038bf467dc6cb3dc8972187ee0046aec442353c Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Tue, 22 Nov 2022 17:00:28 +0800 Subject: [PATCH 019/252] docs: theme switch (#38848) * docs: theme switch * chore: code clean * fix: conflict with theme editor * docs: use own theme in theme editor * chore: code clean --- .dumi/pages/theme-editor/index.tsx | 10 +-- .dumi/theme/common/ThemeSwitch/ThemeIcon.tsx | 20 ++++++ .dumi/theme/common/ThemeSwitch/index.tsx | 68 +++++++++++++++++++ .dumi/theme/layouts/GlobalLayout.tsx | 69 +++++++++++++++----- components/float-button/style/index.tsx | 8 +-- 5 files changed, 149 insertions(+), 26 deletions(-) create mode 100644 .dumi/theme/common/ThemeSwitch/ThemeIcon.tsx create mode 100644 .dumi/theme/common/ThemeSwitch/index.tsx diff --git a/.dumi/pages/theme-editor/index.tsx b/.dumi/pages/theme-editor/index.tsx index 3e812826f634..6ed903ea53dd 100644 --- a/.dumi/pages/theme-editor/index.tsx +++ b/.dumi/pages/theme-editor/index.tsx @@ -1,8 +1,8 @@ import { ThemeEditor } from 'antd-token-previewer'; -import { useContext } from 'react'; -import ThemeContext from '../../theme/slots/ThemeContext'; +import { useState } from 'react'; import useLocale from '../../hooks/useLocale'; import { ConfigProvider } from 'antd'; +import { ThemeConfig } from 'antd/es/config-provider/context'; const locales = { cn: { @@ -15,13 +15,13 @@ const locales = { const CustomTheme = () => { const [locale] = useLocale(locales); - const { setTheme, theme } = useContext(ThemeContext); + const [theme, setTheme] = useState({}); return (
- + { diff --git a/.dumi/theme/common/ThemeSwitch/ThemeIcon.tsx b/.dumi/theme/common/ThemeSwitch/ThemeIcon.tsx new file mode 100644 index 000000000000..cbf413a5d3ee --- /dev/null +++ b/.dumi/theme/common/ThemeSwitch/ThemeIcon.tsx @@ -0,0 +1,20 @@ +import React from 'react'; +import Icon from '@ant-design/icons'; + +const ThemeIcon = (props: any) => { + const SVGIcon = React.useCallback( + () => ( + + + + + + + + ), + [props], + ); + return ; +}; + +export default ThemeIcon; diff --git a/.dumi/theme/common/ThemeSwitch/index.tsx b/.dumi/theme/common/ThemeSwitch/index.tsx new file mode 100644 index 000000000000..3f826031ba3f --- /dev/null +++ b/.dumi/theme/common/ThemeSwitch/index.tsx @@ -0,0 +1,68 @@ +import React, { FC } from 'react'; +import { FloatButton, theme } from 'antd'; +import ThemeIcon from './ThemeIcon'; +import { DarkTheme, Light, CompactTheme } from 'antd-token-previewer/es/icons'; + +const { defaultAlgorithm, darkAlgorithm, compactAlgorithm } = theme; + +export type ThemeSwitchProps = { + value: typeof defaultAlgorithm[]; + onChange: (value: typeof defaultAlgorithm[]) => void; +}; + +const ThemeSwitch: FC = ({ value, onChange }) => { + const handleLightSwitch = () => { + let newValue = [...value]; + if (value.includes(darkAlgorithm)) { + newValue = newValue.filter((item) => item !== darkAlgorithm); + } + if (!value.includes(defaultAlgorithm)) { + newValue.unshift(defaultAlgorithm); + } + onChange(newValue); + }; + + const handleDarkSwitch = () => { + let newValue = [...value]; + if (value.includes(defaultAlgorithm)) { + newValue = newValue.filter((item) => item !== defaultAlgorithm); + } + if (!value.includes(darkAlgorithm)) { + newValue.push(darkAlgorithm); + } + onChange(newValue); + }; + + const handleCompactSwitch = () => { + if (value.includes(compactAlgorithm)) { + onChange(value.filter((item) => item !== compactAlgorithm)); + } else { + onChange([...value, compactAlgorithm]); + } + }; + + return ( + }> + } + type={value.includes(defaultAlgorithm) ? 'primary' : 'default'} + onClick={handleLightSwitch} + tooltip="Light" + /> + } + type={value.includes(darkAlgorithm) ? 'primary' : 'default'} + onClick={handleDarkSwitch} + tooltip="Dark" + /> + } + type={value.includes(compactAlgorithm) ? 'primary' : 'default'} + onClick={handleCompactSwitch} + tooltip="Compact" + /> + + ); +}; + +export default ThemeSwitch; diff --git a/.dumi/theme/layouts/GlobalLayout.tsx b/.dumi/theme/layouts/GlobalLayout.tsx index a7c4c7ea9cee..34c8c9a274e0 100644 --- a/.dumi/theme/layouts/GlobalLayout.tsx +++ b/.dumi/theme/layouts/GlobalLayout.tsx @@ -3,29 +3,60 @@ import { useOutlet } from 'dumi'; import { ConfigProvider, theme as antdTheme } from 'antd'; import { ThemeConfig } from 'antd/es/config-provider/context'; import ThemeContext, { ThemeContextProps } from '../slots/ThemeContext'; +import ThemeSwitch from '../common/ThemeSwitch'; +import useLocation from '../../hooks/useLocation'; const ANT_DESIGN_SITE_THEME = 'antd-site-theme'; +const getAlgorithm = (theme: string) => { + if (theme === 'dark') { + return antdTheme.darkAlgorithm; + } + if (theme === 'compact') { + return antdTheme.compactAlgorithm; + } + return antdTheme.defaultAlgorithm; +}; + +const getThemeString = (algorithm: typeof antdTheme.defaultAlgorithm) => { + if (algorithm === antdTheme.darkAlgorithm) { + return 'dark'; + } + if (algorithm === antdTheme.compactAlgorithm) { + return 'compact'; + } + return 'light'; +}; + const GlobalLayout: FC = () => { const outlet = useOutlet(); + const { pathname } = useLocation(); - const [theme, setTheme] = React.useState({}); + const [theme, setTheme] = React.useState({ + algorithm: [antdTheme.defaultAlgorithm], + }); + + const handleThemeChange = (newTheme: ThemeConfig, ignoreAlgorithm: boolean = true) => { + const nextTheme = { ...newTheme }; + if (ignoreAlgorithm) { + nextTheme.algorithm = theme.algorithm; + } + setTheme(nextTheme); + localStorage.setItem( + ANT_DESIGN_SITE_THEME, + JSON.stringify(nextTheme, (key, value) => { + if (key === 'algorithm') { + return Array.isArray(value) ? value.map((item) => getThemeString(item)) : ['light']; + } + return value; + }), + ); + }; const contextValue = React.useMemo( () => ({ theme, - setTheme: (newTheme) => { - setTheme(newTheme); - localStorage.setItem( - ANT_DESIGN_SITE_THEME, - JSON.stringify(newTheme, (key, value) => { - if (key === 'algorithm') { - return value === antdTheme.darkAlgorithm ? 'dark' : value; - } - return value; - }), - ); - }, + setTheme: handleThemeChange, }), [theme], ); @@ -35,8 +66,8 @@ const GlobalLayout: FC = () => { if (localTheme) { try { const themeConfig = JSON.parse(localTheme); - if (themeConfig.algorithm === 'dark') { - themeConfig.algorithm = antdTheme.darkAlgorithm; + if (themeConfig.algorithm) { + themeConfig.algorithm = themeConfig.algorithm.map((item: string) => getAlgorithm(item)); } setTheme(themeConfig); } catch (e) { @@ -50,11 +81,15 @@ const GlobalLayout: FC = () => { {outlet} + {!pathname.startsWith('/~demos') && ( + handleThemeChange({ ...theme, algorithm: value }, false)} + /> + )} ); diff --git a/components/float-button/style/index.tsx b/components/float-button/style/index.tsx index 6538c6a8c6d9..ecadb8a6a055 100644 --- a/components/float-button/style/index.tsx +++ b/components/float-button/style/index.tsx @@ -234,10 +234,10 @@ const sharedFloatButtonStyle: GenerateStyle = (toke }, }, [`${componentCls}-default`]: { - backgroundColor: token.colorBgContainer, + backgroundColor: token.floatButtonBackgroundColor, transition: `background-color ${token.motionDurationMid}`, [`${componentCls}-body`]: { - backgroundColor: token.colorBgContainer, + backgroundColor: token.floatButtonBackgroundColor, transition: `background-color ${token.motionDurationMid}`, '&:hover': { backgroundColor: token.colorFillContent, @@ -285,7 +285,7 @@ const sharedFloatButtonStyle: GenerateStyle = (toke export default genComponentStyleHook<'FloatButton'>('FloatButton', (token) => { const { colorTextLightSolid, - colorBgContainer, + colorBgElevated, controlHeightLG, marginXXL, marginLG, @@ -294,7 +294,7 @@ export default genComponentStyleHook<'FloatButton'>('FloatButton', (token) => { controlItemBgHover, } = token; const floatButtonToken = mergeToken(token, { - floatButtonBackgroundColor: colorBgContainer, + floatButtonBackgroundColor: colorBgElevated, floatButtonColor: colorTextLightSolid, floatButtonHoverBackgroundColor: controlItemBgHover, floatButtonFontSize: fontSize, From 0cca743a9e9e1f8569c40cfc8ff9ff9152369298 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Nov 2022 17:02:07 +0800 Subject: [PATCH 020/252] docs: fix TextArea showCount demo (#38849) * docs: fix TextArea showCount demo * chore: update snapshot --- .../input/__tests__/__snapshots__/demo-extend.test.ts.snap | 2 +- components/input/__tests__/__snapshots__/demo.test.ts.snap | 2 +- components/input/demo/textarea-show-count.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap index ed6cec3996a3..9c0e1df073f3 100644 --- a/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/input/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -10005,7 +10005,7 @@ Array [