From 9147c970abee8b97780528a36e2064863619b8cd Mon Sep 17 00:00:00 2001 From: xuhuihui Date: Sun, 4 Dec 2022 23:00:41 +0800 Subject: [PATCH 1/7] feat(popconfirm): make title bold and add description prop --- components/popconfirm/PurePanel.tsx | 11 ++++++++++- components/popconfirm/demo/basic.tsx | 3 ++- components/popconfirm/index.en-US.md | 1 + components/popconfirm/index.tsx | 1 + components/popconfirm/index.zh-CN.md | 1 + components/popconfirm/style/index.tsx | 13 +++++++++++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/components/popconfirm/PurePanel.tsx b/components/popconfirm/PurePanel.tsx index 58796e37d0fa..e04006323f44 100644 --- a/components/popconfirm/PurePanel.tsx +++ b/components/popconfirm/PurePanel.tsx @@ -29,6 +29,7 @@ export interface OverlayProps | 'okType' | 'showCancel' | 'title' + | 'description' > { prefixCls: string; close?: Function; @@ -42,6 +43,7 @@ export const Overlay: React.FC = (props) => { okButtonProps, cancelButtonProps, title, + description, cancelText, okText, okType = 'primary', @@ -60,8 +62,15 @@ export const Overlay: React.FC = (props) => {
{icon && {icon}} -
{getRenderPropValue(title)}
+
+ {getRenderPropValue(title)} +
+
{getRenderPropValue(description)}
{showCancel && ( - + (
- + - + ( - + ( - + { }); return ( - console.log('open change')}> + console.log('open change')} + > ); diff --git a/components/popconfirm/demo/render-panel.tsx b/components/popconfirm/demo/render-panel.tsx index 9fed2a6ba902..ae57935fe986 100644 --- a/components/popconfirm/demo/render-panel.tsx +++ b/components/popconfirm/demo/render-panel.tsx @@ -5,8 +5,13 @@ const { _InternalPanelDoNotUseOrYouWillBeFired: InternalPopconfirm } = Popconfir const App: React.FC = () => ( <> - - + + ); From 19c2e8d15ba899985c1cbfad6d67b1185e912c47 Mon Sep 17 00:00:00 2001 From: xuhuihui Date: Mon, 5 Dec 2022 18:27:13 +0800 Subject: [PATCH 3/7] feat(popconfirm): make title bold and add description prop(the update of demos translation) --- components/popconfirm/demo/basic.tsx | 2 +- components/popconfirm/demo/dynamic-trigger.tsx | 4 ++-- components/popconfirm/demo/icon.tsx | 4 ++-- components/popconfirm/demo/locale.tsx | 7 ++++++- components/popconfirm/demo/placement.tsx | 2 +- components/popconfirm/demo/render-panel.tsx | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/components/popconfirm/demo/basic.tsx b/components/popconfirm/demo/basic.tsx index a32c3683eb75..70a999ad0190 100644 --- a/components/popconfirm/demo/basic.tsx +++ b/components/popconfirm/demo/basic.tsx @@ -13,7 +13,7 @@ const cancel = (e: React.MouseEvent) => { const App: React.FC = () => ( { return (
( } > Delete diff --git a/components/popconfirm/demo/locale.tsx b/components/popconfirm/demo/locale.tsx index 4ca4d4287d31..3934e1de5512 100644 --- a/components/popconfirm/demo/locale.tsx +++ b/components/popconfirm/demo/locale.tsx @@ -2,7 +2,12 @@ import React from 'react'; import { Popconfirm } from 'antd'; const App: React.FC = () => ( - + Delete ); diff --git a/components/popconfirm/demo/placement.tsx b/components/popconfirm/demo/placement.tsx index d7c6fd2db6d9..eb96641b4cd0 100644 --- a/components/popconfirm/demo/placement.tsx +++ b/components/popconfirm/demo/placement.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Button, message, Popconfirm } from 'antd'; const text = 'Are you sure to delete this task?'; -const description = '删除任务'; +const description = 'Delete the task'; const confirm = () => { message.info('Clicked on Yes.'); diff --git a/components/popconfirm/demo/render-panel.tsx b/components/popconfirm/demo/render-panel.tsx index ae57935fe986..cb91a85c7f46 100644 --- a/components/popconfirm/demo/render-panel.tsx +++ b/components/popconfirm/demo/render-panel.tsx @@ -5,10 +5,10 @@ const { _InternalPanelDoNotUseOrYouWillBeFired: InternalPopconfirm } = Popconfir const App: React.FC = () => ( <> - + From 29e3ed57bfb31ca2e68c195a4b6c9a1a6594b27b Mon Sep 17 00:00:00 2001 From: xuhuihui Date: Tue, 6 Dec 2022 10:18:06 +0800 Subject: [PATCH 4/7] feat(popconfirm): make title bold and add description prop(the update of snapshot) --- .../__snapshots__/components.test.tsx.snap | 21 ++ .../__snapshots__/index.test.tsx.snap | 201 ++++++++++++++++++ .../__snapshots__/demo-extend.test.ts.snap | 148 ++++++++++--- .../__tests__/__snapshots__/demo.test.ts.snap | 14 +- .../__snapshots__/index.test.tsx.snap | 6 +- .../__snapshots__/demo-extend.test.ts.snap | 9 + .../__snapshots__/demo-extend.test.ts.snap | 6 + 7 files changed, 376 insertions(+), 29 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap index ff54c0429e9f..e1a3c8f52aac 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap @@ -20992,6 +20992,9 @@ exports[`ConfigProvider components Popconfirm configProvider 1`] = ` class="config-popconfirm-message-title" />
+
@@ -21079,6 +21082,9 @@ exports[`ConfigProvider components Popconfirm configProvider componentDisabled 1 class="config-popconfirm-message-title" />
+
@@ -21168,6 +21174,9 @@ exports[`ConfigProvider components Popconfirm configProvider componentSize large class="config-popconfirm-message-title" />
+
@@ -21255,6 +21264,9 @@ exports[`ConfigProvider components Popconfirm configProvider componentSize middl class="config-popconfirm-message-title" />
+
@@ -21342,6 +21354,9 @@ exports[`ConfigProvider components Popconfirm configProvider virtual and dropdow class="ant-popconfirm-message-title" />
+
@@ -21429,6 +21444,9 @@ exports[`ConfigProvider components Popconfirm normal 1`] = ` class="ant-popconfirm-message-title" />
+
@@ -21516,6 +21534,9 @@ exports[`ConfigProvider components Popconfirm prefixCls 1`] = ` class="prefix-Popconfirm-message-title" />
+
diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap b/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap index 0b4cd8b09523..31d33201db6e 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap @@ -5376,6 +5376,9 @@ exports[`Locale Provider should display the text as ar 1`] = ` Question?
+
@@ -10479,6 +10482,9 @@ exports[`Locale Provider should display the text as az 1`] = ` Question?
+
@@ -15582,6 +15588,9 @@ exports[`Locale Provider should display the text as bg 1`] = ` Question?
+
@@ -20685,6 +20694,9 @@ exports[`Locale Provider should display the text as bn-bd 1`] = ` Question?
+
@@ -25788,6 +25800,9 @@ exports[`Locale Provider should display the text as by 1`] = ` Question?
+
@@ -30891,6 +30906,9 @@ exports[`Locale Provider should display the text as ca 1`] = ` Question?
+
@@ -35994,6 +36012,9 @@ exports[`Locale Provider should display the text as cs 1`] = ` Question?
+
@@ -41097,6 +41118,9 @@ exports[`Locale Provider should display the text as da 1`] = ` Question?
+
@@ -46200,6 +46224,9 @@ exports[`Locale Provider should display the text as de 1`] = ` Question?
+
@@ -51303,6 +51330,9 @@ exports[`Locale Provider should display the text as el 1`] = ` Question?
+
@@ -56406,6 +56436,9 @@ exports[`Locale Provider should display the text as en 1`] = ` Question?
+
@@ -61509,6 +61542,9 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` Question?
+
@@ -66612,6 +66648,9 @@ exports[`Locale Provider should display the text as es 1`] = ` Question?
+
@@ -71715,6 +71754,9 @@ exports[`Locale Provider should display the text as et 1`] = ` Question?
+
@@ -76818,6 +76860,9 @@ exports[`Locale Provider should display the text as fa 1`] = ` Question?
+
@@ -81921,6 +81966,9 @@ exports[`Locale Provider should display the text as fi 1`] = ` Question?
+
@@ -87024,6 +87072,9 @@ exports[`Locale Provider should display the text as fr 1`] = ` Question?
+
@@ -92127,6 +92178,9 @@ exports[`Locale Provider should display the text as fr 2`] = ` Question?
+
@@ -97230,6 +97284,9 @@ exports[`Locale Provider should display the text as fr 3`] = ` Question?
+
@@ -102333,6 +102390,9 @@ exports[`Locale Provider should display the text as ga 1`] = ` Question?
+
@@ -107436,6 +107496,9 @@ exports[`Locale Provider should display the text as gl 1`] = ` Question?
+
@@ -112539,6 +112602,9 @@ exports[`Locale Provider should display the text as he 1`] = ` Question?
+
@@ -117642,6 +117708,9 @@ exports[`Locale Provider should display the text as hi 1`] = ` Question?
+
@@ -122745,6 +122814,9 @@ exports[`Locale Provider should display the text as hr 1`] = ` Question?
+
@@ -127848,6 +127920,9 @@ exports[`Locale Provider should display the text as hu 1`] = ` Question?
+
@@ -132951,6 +133026,9 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` Question?
+
@@ -138054,6 +138132,9 @@ exports[`Locale Provider should display the text as id 1`] = ` Question?
+
@@ -143157,6 +143238,9 @@ exports[`Locale Provider should display the text as is 1`] = ` Question?
+
@@ -148260,6 +148344,9 @@ exports[`Locale Provider should display the text as it 1`] = ` Question?
+
@@ -153363,6 +153450,9 @@ exports[`Locale Provider should display the text as ja 1`] = ` Question?
+
@@ -158466,6 +158556,9 @@ exports[`Locale Provider should display the text as ka 1`] = ` Question?
+
@@ -163569,6 +163662,9 @@ exports[`Locale Provider should display the text as kk 1`] = ` Question?
+
@@ -168672,6 +168768,9 @@ exports[`Locale Provider should display the text as km 1`] = ` Question?
+
@@ -173773,6 +173872,9 @@ exports[`Locale Provider should display the text as kn 1`] = ` Question?
+
@@ -178876,6 +178978,9 @@ exports[`Locale Provider should display the text as ko 1`] = ` Question?
+
@@ -183979,6 +184084,9 @@ exports[`Locale Provider should display the text as ku 1`] = ` Question?
+
@@ -189082,6 +189190,9 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` Question?
+
@@ -194185,6 +194296,9 @@ exports[`Locale Provider should display the text as lt 1`] = ` Question?
+
@@ -199288,6 +199402,9 @@ exports[`Locale Provider should display the text as lv 1`] = ` Question?
+
@@ -204391,6 +204508,9 @@ exports[`Locale Provider should display the text as mk 1`] = ` Question?
+
@@ -209494,6 +209614,9 @@ exports[`Locale Provider should display the text as ml 1`] = ` Question?
+
@@ -214597,6 +214720,9 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` Question?
+
@@ -219700,6 +219826,9 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` Question?
+
@@ -224803,6 +224932,9 @@ exports[`Locale Provider should display the text as nb 1`] = ` Question?
+
@@ -229906,6 +230038,9 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` Question?
+
@@ -235009,6 +235144,9 @@ exports[`Locale Provider should display the text as nl 1`] = ` Question?
+
@@ -240112,6 +240250,9 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` Question?
+
@@ -245215,6 +245356,9 @@ exports[`Locale Provider should display the text as pl 1`] = ` Question?
+
@@ -250318,6 +250462,9 @@ exports[`Locale Provider should display the text as pt 1`] = ` Question?
+
@@ -255421,6 +255568,9 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` Question?
+
@@ -260524,6 +260674,9 @@ exports[`Locale Provider should display the text as ro 1`] = ` Question?
+
@@ -265627,6 +265780,9 @@ exports[`Locale Provider should display the text as ru 1`] = ` Question?
+
@@ -270730,6 +270886,9 @@ exports[`Locale Provider should display the text as si 1`] = ` Question?
+
@@ -275833,6 +275992,9 @@ exports[`Locale Provider should display the text as sk 1`] = ` Question?
+
@@ -280936,6 +281098,9 @@ exports[`Locale Provider should display the text as sl 1`] = ` Question?
+
@@ -286039,6 +286204,9 @@ exports[`Locale Provider should display the text as sr 1`] = ` Question?
+
@@ -291142,6 +291310,9 @@ exports[`Locale Provider should display the text as sv 1`] = ` Question?
+
@@ -296245,6 +296416,9 @@ exports[`Locale Provider should display the text as ta 1`] = ` Question?
+
@@ -301348,6 +301522,9 @@ exports[`Locale Provider should display the text as th 1`] = ` Question?
+
@@ -306451,6 +306628,9 @@ exports[`Locale Provider should display the text as tk 1`] = ` Question?
+
@@ -311554,6 +311734,9 @@ exports[`Locale Provider should display the text as tr 1`] = ` Question?
+
@@ -316657,6 +316840,9 @@ exports[`Locale Provider should display the text as uk 1`] = ` Question?
+
@@ -321760,6 +321946,9 @@ exports[`Locale Provider should display the text as ur 1`] = ` Question?
+
@@ -326863,6 +327052,9 @@ exports[`Locale Provider should display the text as vi 1`] = ` Question?
+
@@ -331966,6 +332158,9 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` Question?
+
@@ -337069,6 +337264,9 @@ exports[`Locale Provider should display the text as zh-hk 1`] = ` Question?
+
@@ -342172,6 +342370,9 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` Question?
+
diff --git a/components/popconfirm/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/popconfirm/__tests__/__snapshots__/demo-extend.test.ts.snap index a0f5a47fee43..375e5807b850 100644 --- a/components/popconfirm/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/popconfirm/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -59,11 +59,16 @@ Array [
Title
+
+ Open Popconfirm with async logic +
@@ -148,11 +153,16 @@ Array [
- Are you sure to delete this task? + Delete the task
+
+ Are you sure to delete this task? +
@@ -237,11 +247,16 @@ exports[`renders ./components/popconfirm/demo/dynamic-trigger.tsx extend context
- Are you sure delete this task? + Delete the task
+
+ Are you sure to delete this task? +
@@ -353,11 +368,16 @@ Array [
- Are you sure? + Delete the task
+
+ Are you sure to delete this task? +
@@ -442,11 +462,16 @@ Array [
- Are you sure? + Delete the task
+
+ Are you sure to delete this task? +
@@ -539,11 +564,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -626,11 +656,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -713,11 +748,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -804,11 +844,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -891,11 +936,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -978,11 +1028,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -1069,11 +1124,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -1156,11 +1216,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -1243,11 +1308,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -1334,11 +1404,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -1421,11 +1496,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -1508,11 +1588,16 @@ exports[`renders ./components/popconfirm/demo/placement.tsx extend context corre
Are you sure to delete this task?
+
+ Delete the task +
@@ -1601,11 +1686,16 @@ Array [
Title
+
+ Open Popconfirm with Promise +
@@ -1679,11 +1769,16 @@ Array [
Are you OK?
+
+ Does this look good? +
@@ -1753,11 +1848,16 @@ Array [
Are you OK?
+
+ Does this look good? +
diff --git a/components/popconfirm/__tests__/__snapshots__/demo.test.ts.snap b/components/popconfirm/__tests__/__snapshots__/demo.test.ts.snap index 9f5cb0f01003..9fcc2be36da8 100644 --- a/components/popconfirm/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/popconfirm/__tests__/__snapshots__/demo.test.ts.snap @@ -243,11 +243,16 @@ Array [
Are you OK?
+
+ Does this look good? +
@@ -317,11 +322,16 @@ Array [
Are you OK?
+
+ Does this look good? +
diff --git a/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap b/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap index a2f125ceb489..e3d050da7f05 100644 --- a/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap @@ -2,8 +2,8 @@ exports[`Popconfirm rtl render component should be rendered correctly in RTL direction 1`] = ``; -exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"
"`; +exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"
"`; -exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
"`; +exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
"`; -exports[`Popconfirm shows content for render functions 1`] = `"
"`; +exports[`Popconfirm shows content for render functions 1`] = `"
"`; diff --git a/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap index d0311c2e7157..eaa39157355f 100644 --- a/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -293,6 +293,9 @@ exports[`renders ./components/space/demo/base.tsx extend context correctly 1`] = Are you sure delete this task?
+
@@ -14511,6 +14514,9 @@ exports[`renders ./components/space/demo/debug.tsx extend context correctly 1`] Are you sure delete this task?
+
@@ -14610,6 +14616,9 @@ exports[`renders ./components/space/demo/debug.tsx extend context correctly 1`] Are you sure delete this task?
+
diff --git a/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap index fe7fab85c7a0..13baecf4b341 100644 --- a/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -4868,6 +4868,9 @@ exports[`renders ./components/table/demo/edit-cell.tsx extend context correctly Sure to delete?
+
@@ -4979,6 +4982,9 @@ exports[`renders ./components/table/demo/edit-cell.tsx extend context correctly Sure to delete?
+
From 2d20e79ff99353c3aee647ba94a28b80694d849c Mon Sep 17 00:00:00 2001 From: xuhuihui Date: Tue, 6 Dec 2022 19:37:12 +0800 Subject: [PATCH 5/7] feat(popconfirm): make title bold and add description prop(the update of popconfirm md) --- components/popconfirm/demo/basic.md | 7 ++++--- components/popconfirm/index.en-US.md | 2 +- components/popconfirm/index.zh-CN.md | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/popconfirm/demo/basic.md b/components/popconfirm/demo/basic.md index 5505927cd179..05f13fd9751d 100755 --- a/components/popconfirm/demo/basic.md +++ b/components/popconfirm/demo/basic.md @@ -1,7 +1,8 @@ ## zh-CN -最简单的用法。 - +最简单的用法,支持确认标题和描述。 +> `description` 在 `5.1.0` 版本中支持。 ## en-US -The basic example. +The basic example supports the title and description props of confirmation. +> `description` is supported in version `5.1.0`. diff --git a/components/popconfirm/index.en-US.md b/components/popconfirm/index.en-US.md index 9803fac67f41..36290d5d3784 100644 --- a/components/popconfirm/index.en-US.md +++ b/components/popconfirm/index.en-US.md @@ -40,7 +40,7 @@ The difference with the `confirm` modal dialog is that it's more lightweight tha | okType | Button `type` of the Confirm button | string | `primary` | | | showCancel | Show cancel button | boolean | true | 4.18.0 | | title | The title of the confirmation box | ReactNode \| () => ReactNode | - | | -| title | The description of the confirmation box title | ReactNode \| () => ReactNode | - | | +| description | The description of the confirmation box title | ReactNode \| () => ReactNode | - | 5.1.0 | | onCancel | A callback of cancel | function(e) | - | | | onConfirm | A callback of confirmation | function(e) | - | | diff --git a/components/popconfirm/index.zh-CN.md b/components/popconfirm/index.zh-CN.md index 7a42996facb0..c57e2ccb1621 100644 --- a/components/popconfirm/index.zh-CN.md +++ b/components/popconfirm/index.zh-CN.md @@ -40,8 +40,8 @@ demo: | okText | 确认按钮文字 | string | `确定` | | | okType | 确认按钮类型 | string | `primary` | | | showCancel | 是否显示取消按钮 | boolean | true | 4.18.0 | -| title | 确认框的描述 | ReactNode \| () => ReactNode | - | | -| description | 对确认框标题的描述 | ReactNode \| () => ReactNode | - | | +| title | 确认框标题 | ReactNode \| () => ReactNode | - | | +| description | 确认内容的详细描述 | ReactNode \| () => ReactNode | - | 5.1.0 | | onCancel | 点击取消的回调 | function(e) | - | | | onConfirm | 点击确认的回调 | function(e) | - | | From b223ea0793b818941fcfebbeac2eebbe60c3adc4 Mon Sep 17 00:00:00 2001 From: xhh0223 Date: Tue, 6 Dec 2022 23:37:50 +0800 Subject: [PATCH 6/7] feat(popconfirm): make title bold and add description prop(the update of popconfirm md)2 --- components/popconfirm/demo/basic.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/popconfirm/demo/basic.md b/components/popconfirm/demo/basic.md index 05f13fd9751d..a872fe2c23b9 100755 --- a/components/popconfirm/demo/basic.md +++ b/components/popconfirm/demo/basic.md @@ -1,8 +1,11 @@ ## zh-CN 最简单的用法,支持确认标题和描述。 + > `description` 在 `5.1.0` 版本中支持。 + ## en-US The basic example supports the title and description props of confirmation. + > `description` is supported in version `5.1.0`. From d1cf4fd944566b9054bbe9d7e2d1000aa4141754 Mon Sep 17 00:00:00 2001 From: xuhuihui Date: Wed, 7 Dec 2022 12:28:32 +0800 Subject: [PATCH 7/7] feat(popconfirm): make title bold and add description prop(run all test.ts.snaps and update popconfirm) --- .../__snapshots__/components.test.tsx.snap | 21 -- .../__snapshots__/index.test.tsx.snap | 201 ------------------ components/popconfirm/PurePanel.tsx | 4 +- .../__snapshots__/index.test.tsx.snap | 6 +- .../__snapshots__/demo-extend.test.ts.snap | 9 - .../__snapshots__/demo-extend.test.ts.snap | 6 - 6 files changed, 6 insertions(+), 241 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap index e1a3c8f52aac..ff54c0429e9f 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap @@ -20992,9 +20992,6 @@ exports[`ConfigProvider components Popconfirm configProvider 1`] = ` class="config-popconfirm-message-title" />
-
@@ -21082,9 +21079,6 @@ exports[`ConfigProvider components Popconfirm configProvider componentDisabled 1 class="config-popconfirm-message-title" />
-
@@ -21174,9 +21168,6 @@ exports[`ConfigProvider components Popconfirm configProvider componentSize large class="config-popconfirm-message-title" />
-
@@ -21264,9 +21255,6 @@ exports[`ConfigProvider components Popconfirm configProvider componentSize middl class="config-popconfirm-message-title" />
-
@@ -21354,9 +21342,6 @@ exports[`ConfigProvider components Popconfirm configProvider virtual and dropdow class="ant-popconfirm-message-title" />
-
@@ -21444,9 +21429,6 @@ exports[`ConfigProvider components Popconfirm normal 1`] = ` class="ant-popconfirm-message-title" />
-
@@ -21534,9 +21516,6 @@ exports[`ConfigProvider components Popconfirm prefixCls 1`] = ` class="prefix-Popconfirm-message-title" />
-
diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap b/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap index 31d33201db6e..0b4cd8b09523 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.tsx.snap @@ -5376,9 +5376,6 @@ exports[`Locale Provider should display the text as ar 1`] = ` Question?
-
@@ -10482,9 +10479,6 @@ exports[`Locale Provider should display the text as az 1`] = ` Question?
-
@@ -15588,9 +15582,6 @@ exports[`Locale Provider should display the text as bg 1`] = ` Question?
-
@@ -20694,9 +20685,6 @@ exports[`Locale Provider should display the text as bn-bd 1`] = ` Question?
-
@@ -25800,9 +25788,6 @@ exports[`Locale Provider should display the text as by 1`] = ` Question?
-
@@ -30906,9 +30891,6 @@ exports[`Locale Provider should display the text as ca 1`] = ` Question?
-
@@ -36012,9 +35994,6 @@ exports[`Locale Provider should display the text as cs 1`] = ` Question?
-
@@ -41118,9 +41097,6 @@ exports[`Locale Provider should display the text as da 1`] = ` Question?
-
@@ -46224,9 +46200,6 @@ exports[`Locale Provider should display the text as de 1`] = ` Question?
-
@@ -51330,9 +51303,6 @@ exports[`Locale Provider should display the text as el 1`] = ` Question?
-
@@ -56436,9 +56406,6 @@ exports[`Locale Provider should display the text as en 1`] = ` Question?
-
@@ -61542,9 +61509,6 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` Question?
-
@@ -66648,9 +66612,6 @@ exports[`Locale Provider should display the text as es 1`] = ` Question?
-
@@ -71754,9 +71715,6 @@ exports[`Locale Provider should display the text as et 1`] = ` Question?
-
@@ -76860,9 +76818,6 @@ exports[`Locale Provider should display the text as fa 1`] = ` Question?
-
@@ -81966,9 +81921,6 @@ exports[`Locale Provider should display the text as fi 1`] = ` Question?
-
@@ -87072,9 +87024,6 @@ exports[`Locale Provider should display the text as fr 1`] = ` Question?
-
@@ -92178,9 +92127,6 @@ exports[`Locale Provider should display the text as fr 2`] = ` Question?
-
@@ -97284,9 +97230,6 @@ exports[`Locale Provider should display the text as fr 3`] = ` Question?
-
@@ -102390,9 +102333,6 @@ exports[`Locale Provider should display the text as ga 1`] = ` Question?
-
@@ -107496,9 +107436,6 @@ exports[`Locale Provider should display the text as gl 1`] = ` Question?
-
@@ -112602,9 +112539,6 @@ exports[`Locale Provider should display the text as he 1`] = ` Question?
-
@@ -117708,9 +117642,6 @@ exports[`Locale Provider should display the text as hi 1`] = ` Question?
-
@@ -122814,9 +122745,6 @@ exports[`Locale Provider should display the text as hr 1`] = ` Question?
-
@@ -127920,9 +127848,6 @@ exports[`Locale Provider should display the text as hu 1`] = ` Question?
-
@@ -133026,9 +132951,6 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` Question?
-
@@ -138132,9 +138054,6 @@ exports[`Locale Provider should display the text as id 1`] = ` Question?
-
@@ -143238,9 +143157,6 @@ exports[`Locale Provider should display the text as is 1`] = ` Question?
-
@@ -148344,9 +148260,6 @@ exports[`Locale Provider should display the text as it 1`] = ` Question?
-
@@ -153450,9 +153363,6 @@ exports[`Locale Provider should display the text as ja 1`] = ` Question?
-
@@ -158556,9 +158466,6 @@ exports[`Locale Provider should display the text as ka 1`] = ` Question?
-
@@ -163662,9 +163569,6 @@ exports[`Locale Provider should display the text as kk 1`] = ` Question?
-
@@ -168768,9 +168672,6 @@ exports[`Locale Provider should display the text as km 1`] = ` Question?
-
@@ -173872,9 +173773,6 @@ exports[`Locale Provider should display the text as kn 1`] = ` Question?
-
@@ -178978,9 +178876,6 @@ exports[`Locale Provider should display the text as ko 1`] = ` Question?
-
@@ -184084,9 +183979,6 @@ exports[`Locale Provider should display the text as ku 1`] = ` Question?
-
@@ -189190,9 +189082,6 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` Question?
-
@@ -194296,9 +194185,6 @@ exports[`Locale Provider should display the text as lt 1`] = ` Question?
-
@@ -199402,9 +199288,6 @@ exports[`Locale Provider should display the text as lv 1`] = ` Question?
-
@@ -204508,9 +204391,6 @@ exports[`Locale Provider should display the text as mk 1`] = ` Question?
-
@@ -209614,9 +209494,6 @@ exports[`Locale Provider should display the text as ml 1`] = ` Question?
-
@@ -214720,9 +214597,6 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` Question?
-
@@ -219826,9 +219700,6 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` Question?
-
@@ -224932,9 +224803,6 @@ exports[`Locale Provider should display the text as nb 1`] = ` Question?
-
@@ -230038,9 +229906,6 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` Question?
-
@@ -235144,9 +235009,6 @@ exports[`Locale Provider should display the text as nl 1`] = ` Question?
-
@@ -240250,9 +240112,6 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` Question?
-
@@ -245356,9 +245215,6 @@ exports[`Locale Provider should display the text as pl 1`] = ` Question?
-
@@ -250462,9 +250318,6 @@ exports[`Locale Provider should display the text as pt 1`] = ` Question?
-
@@ -255568,9 +255421,6 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` Question?
-
@@ -260674,9 +260524,6 @@ exports[`Locale Provider should display the text as ro 1`] = ` Question?
-
@@ -265780,9 +265627,6 @@ exports[`Locale Provider should display the text as ru 1`] = ` Question?
-
@@ -270886,9 +270730,6 @@ exports[`Locale Provider should display the text as si 1`] = ` Question?
-
@@ -275992,9 +275833,6 @@ exports[`Locale Provider should display the text as sk 1`] = ` Question?
-
@@ -281098,9 +280936,6 @@ exports[`Locale Provider should display the text as sl 1`] = ` Question?
-
@@ -286204,9 +286039,6 @@ exports[`Locale Provider should display the text as sr 1`] = ` Question?
-
@@ -291310,9 +291142,6 @@ exports[`Locale Provider should display the text as sv 1`] = ` Question?
-
@@ -296416,9 +296245,6 @@ exports[`Locale Provider should display the text as ta 1`] = ` Question?
-
@@ -301522,9 +301348,6 @@ exports[`Locale Provider should display the text as th 1`] = ` Question?
-
@@ -306628,9 +306451,6 @@ exports[`Locale Provider should display the text as tk 1`] = ` Question?
-
@@ -311734,9 +311554,6 @@ exports[`Locale Provider should display the text as tr 1`] = ` Question?
-
@@ -316840,9 +316657,6 @@ exports[`Locale Provider should display the text as uk 1`] = ` Question?
-
@@ -321946,9 +321760,6 @@ exports[`Locale Provider should display the text as ur 1`] = ` Question?
-
@@ -327052,9 +326863,6 @@ exports[`Locale Provider should display the text as vi 1`] = ` Question?
-
@@ -332158,9 +331966,6 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` Question?
-
@@ -337264,9 +337069,6 @@ exports[`Locale Provider should display the text as zh-hk 1`] = ` Question?
-
@@ -342370,9 +342172,6 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` Question?
-
diff --git a/components/popconfirm/PurePanel.tsx b/components/popconfirm/PurePanel.tsx index e04006323f44..6c9f25c3a1f6 100644 --- a/components/popconfirm/PurePanel.tsx +++ b/components/popconfirm/PurePanel.tsx @@ -70,7 +70,9 @@ export const Overlay: React.FC = (props) => { {getRenderPropValue(title)}
-
{getRenderPropValue(description)}
+ {description && ( +
{getRenderPropValue(description)}
+ )}
{showCancel && (
"`; +exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"
"`; -exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
"`; +exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
"`; -exports[`Popconfirm shows content for render functions 1`] = `"
"`; +exports[`Popconfirm shows content for render functions 1`] = `"
"`; diff --git a/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap index eaa39157355f..d0311c2e7157 100644 --- a/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/space/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -293,9 +293,6 @@ exports[`renders ./components/space/demo/base.tsx extend context correctly 1`] = Are you sure delete this task?
-
@@ -14514,9 +14511,6 @@ exports[`renders ./components/space/demo/debug.tsx extend context correctly 1`] Are you sure delete this task?
-
@@ -14616,9 +14610,6 @@ exports[`renders ./components/space/demo/debug.tsx extend context correctly 1`] Are you sure delete this task?
-
diff --git a/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap index 13baecf4b341..fe7fab85c7a0 100644 --- a/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -4868,9 +4868,6 @@ exports[`renders ./components/table/demo/edit-cell.tsx extend context correctly Sure to delete?
-
@@ -4982,9 +4979,6 @@ exports[`renders ./components/table/demo/edit-cell.tsx extend context correctly Sure to delete?
-