diff --git a/components/affix/index.tsx b/components/affix/index.tsx index f7e5939e0c..41e670a76e 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -21,14 +21,14 @@ function getDefaultTarget() { // Affix export interface AffixProps { - /** 距离窗口顶部达到指定偏移量后触发 */ + /** Triggered when the specified offset is reached from the top of the window */ offsetTop?: number; - /** 距离窗口底部达到指定偏移量后触发 */ + /** Triggered when the specified offset is reached from the bottom of the window */ offsetBottom?: number; style?: React.CSSProperties; - /** 固定状态改变时触发的回调函数 */ + /** Callback function triggered when fixed state changes */ onChange?: (affixed?: boolean) => void; - /** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */ + /** Set the element that Affix needs to listen to its scroll event, the value is a function that returns the corresponding DOM element */ target?: () => Window | HTMLElement | null; prefixCls?: string; className?: string; diff --git a/components/alert/index.tsx b/components/alert/index.tsx index 47f01f8f3b..e5cbedd01b 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -132,7 +132,7 @@ const Alert: CompoundedComponent = ({ if (type !== undefined) { return type; } - // banner 模式默认为警告 + // banner mode defaults to 'warning' return banner ? 'warning' : 'info'; }; @@ -140,7 +140,7 @@ const Alert: CompoundedComponent = ({ const isClosable = closeText ? true : closable; const type = getType(); - // banner 模式默认有 Icon + // banner mode defaults to Icon const isShowIcon = banner && showIcon === undefined ? true : showIcon; const alertCls = classNames( diff --git a/components/avatar/__tests__/Avatar.test.tsx b/components/avatar/__tests__/Avatar.test.tsx index e07ac6bbb2..0ff9be3b89 100644 --- a/components/avatar/__tests__/Avatar.test.tsx +++ b/components/avatar/__tests__/Avatar.test.tsx @@ -53,7 +53,7 @@ describe('Avatar Render', () => { it('should handle onError correctly', () => { const LOAD_FAILURE_SRC = 'http://error.url/'; - const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random'; + const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel'; const Foo: React.FC = () => { const [avatarSrc, setAvatarSrc] = useState( LOAD_FAILURE_SRC, @@ -75,7 +75,7 @@ describe('Avatar Render', () => { it('should show image on success after a failure state', () => { const LOAD_FAILURE_SRC = 'http://error.url'; - const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random'; + const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel'; const div = global.document.createElement('div'); global.document.body.appendChild(div); @@ -172,7 +172,7 @@ describe('Avatar Render', () => { }); it('should exist crossorigin attribute', () => { - const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random'; + const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel'; const crossOrigin = 'anonymous'; const { container } = render( @@ -184,7 +184,7 @@ describe('Avatar Render', () => { }); it('should not exist crossorigin attribute', () => { - const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random'; + const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel'; const { container } = render(crossorigin); expect(container.querySelector('img')?.crossOrigin).toBeFalsy(); expect(container.querySelector('img')?.crossOrigin).toEqual(''); diff --git a/components/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap b/components/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap index bc692839d4..a07848455e 100644 --- a/components/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap +++ b/components/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap @@ -140,7 +140,7 @@ exports[`Avatar Render should handle onError correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > `; @@ -163,7 +163,7 @@ exports[`Avatar Render should show image on success after a failure state 2`] = class="ant-avatar ant-avatar-circle ant-avatar-image" > `; diff --git a/components/avatar/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/avatar/__tests__/__snapshots__/demo-extend.test.ts.snap index 670ac3ac34..47fdac09f6 100644 --- a/components/avatar/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/avatar/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -415,7 +415,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > ) => void; /* callback when img load error */ - /* return false to prevent Avatar show default fallback behavior, then you can do fallback by your self */ + /* return false to prevent Avatar show default fallback behavior, then you can do fallback by yourself */ onError?: () => boolean; } diff --git a/components/avatar/demo/group.tsx b/components/avatar/demo/group.tsx index 61c70eb01a..b3534e3d6f 100644 --- a/components/avatar/demo/group.tsx +++ b/components/avatar/demo/group.tsx @@ -5,7 +5,7 @@ import React from 'react'; const App: React.FC = () => ( <> - + K @@ -16,7 +16,7 @@ const App: React.FC = () => ( - + K } /> @@ -29,7 +29,7 @@ const App: React.FC = () => ( size="large" maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }} > - + K } /> diff --git a/components/card/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/card/__tests__/__snapshots__/demo-extend.test.ts.snap index aed17f7f1c..60bdaa15b2 100644 --- a/components/card/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/card/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -601,7 +601,7 @@ exports[`renders components/card/demo/meta.tsx extend context correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > diff --git a/components/card/__tests__/__snapshots__/demo.test.ts.snap b/components/card/__tests__/__snapshots__/demo.test.ts.snap index 7aca6084c9..189098480a 100644 --- a/components/card/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/card/__tests__/__snapshots__/demo.test.ts.snap @@ -601,7 +601,7 @@ exports[`renders components/card/demo/meta.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > diff --git a/components/card/demo/loading.tsx b/components/card/demo/loading.tsx index 7bd6ae8b40..c73b67197d 100644 --- a/components/card/demo/loading.tsx +++ b/components/card/demo/loading.tsx @@ -16,7 +16,7 @@ const App: React.FC = () => { } + avatar={} title="Card title" description="This is the description" /> @@ -31,7 +31,7 @@ const App: React.FC = () => { > } + avatar={} title="Card title" description="This is the description" /> diff --git a/components/card/demo/meta.tsx b/components/card/demo/meta.tsx index e2628041e5..0f61cf368f 100644 --- a/components/card/demo/meta.tsx +++ b/components/card/demo/meta.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { EditOutlined,EllipsisOutlined,SettingOutlined } from '@ant-design/icons'; -import { Avatar,Card } from 'antd'; +import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'; +import { Avatar, Card } from 'antd'; const { Meta } = Card; @@ -20,7 +20,7 @@ const App: React.FC = () => ( ]} > } + avatar={} title="Card title" description="This is the description" /> diff --git a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap index 8ef2c54971..e3488cf6b1 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap @@ -14855,7 +14855,7 @@ exports[`ConfigProvider components List configProvider 1`] = ` class="config-avatar config-avatar-circle config-avatar-image" > @@ -14907,7 +14907,7 @@ exports[`ConfigProvider components List configProvider componentDisabled 1`] = ` class="config-avatar config-avatar-circle config-avatar-image" > @@ -14959,7 +14959,7 @@ exports[`ConfigProvider components List configProvider componentSize large 1`] = class="config-avatar config-avatar-circle config-avatar-image" > @@ -15011,7 +15011,7 @@ exports[`ConfigProvider components List configProvider componentSize middle 1`] class="config-avatar config-avatar-circle config-avatar-image" > @@ -15063,7 +15063,7 @@ exports[`ConfigProvider components List normal 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -15115,7 +15115,7 @@ exports[`ConfigProvider components List prefixCls 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > diff --git a/components/config-provider/__tests__/components.test.tsx b/components/config-provider/__tests__/components.test.tsx index 71f9b14480..0064ee13bd 100644 --- a/components/config-provider/__tests__/components.test.tsx +++ b/components/config-provider/__tests__/components.test.tsx @@ -342,7 +342,7 @@ describe('ConfigProvider', () => { } + avatar={} title="Ant Design" description="Ant Design, a design language for background applications, is refined by Ant UED Team" /> diff --git a/components/empty/style/index.ts b/components/empty/style/index.ts index cbd26ad67b..79500e8251 100644 --- a/components/empty/style/index.ts +++ b/components/empty/style/index.ts @@ -34,6 +34,7 @@ const genSharedEmptyStyle: GenerateStyle = (token): CSSObject => { }, svg: { + maxWidth: '100%', height: '100%', margin: 'auto', }, diff --git a/components/form/FormItem/ItemHolder.tsx b/components/form/FormItem/ItemHolder.tsx index 3f9af59c35..d338594325 100644 --- a/components/form/FormItem/ItemHolder.tsx +++ b/components/form/FormItem/ItemHolder.tsx @@ -186,8 +186,8 @@ export default function ItemHolder(props: ItemHolderProps) { {/* Label */} diff --git a/components/form/FormItem/index.tsx b/components/form/FormItem/index.tsx index 4c0612c18e..02b464736d 100644 --- a/components/form/FormItem/index.tsx +++ b/components/form/FormItem/index.tsx @@ -51,7 +51,7 @@ const MemoInput = React.memo( ); export interface FormItemProps - extends FormItemLabelProps, + extends Omit, FormItemInputProps, RcFieldProps { prefixCls?: string; @@ -106,6 +106,7 @@ function InternalFormItem(props: FormItemProps): React.Rea trigger = 'onChange', validateTrigger, hidden, + help, } = props; const { getPrefixCls } = React.useContext(ConfigContext); const { name: formName } = React.useContext(FormContext); @@ -145,7 +146,7 @@ function InternalFormItem(props: FormItemProps): React.Rea setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true); // Bump to parent since noStyle - if (noStyle && notifyParentMetaChange) { + if (noStyle && help !== false && notifyParentMetaChange) { let namePath = nextMeta.name; if (!nextMeta.destroy) { @@ -322,9 +323,9 @@ function InternalFormItem(props: FormItemProps): React.Rea childProps.id = fieldId; } - if (props.help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) { + if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) { const describedbyArr = []; - if (props.help || mergedErrors.length > 0) { + if (help || mergedErrors.length > 0) { describedbyArr.push(`${fieldId}_help`); } if (props.extra) { diff --git a/components/form/FormItemLabel.tsx b/components/form/FormItemLabel.tsx index 89f01ab0b8..a8f4dace0e 100644 --- a/components/form/FormItemLabel.tsx +++ b/components/form/FormItemLabel.tsx @@ -38,6 +38,9 @@ export interface FormItemLabelProps { label?: React.ReactNode; labelAlign?: FormLabelAlign; labelCol?: ColProps; + /** + * @internal Used for pass `requiredMark` from `
` + */ requiredMark?: RequiredMark; tooltip?: LabelTooltipType; } diff --git a/components/form/__tests__/index.test.tsx b/components/form/__tests__/index.test.tsx index e7a9cc3860..b5023db4f5 100644 --- a/components/form/__tests__/index.test.tsx +++ b/components/form/__tests__/index.test.tsx @@ -171,6 +171,43 @@ describe('Form', () => { await waitFakeTimer(2000, 2000); expect(container.querySelector('.ant-form-item-explain-error')).toHaveTextContent('aaa'); }); + + // https://github.com/ant-design/ant-design/issues/41620 + it('should not throw error when `help=false` and `noStyle=true`', async () => { + const App = (props: { help?: boolean | React.ReactNode }) => { + const { help = false } = props || {}; + return ( + + + + + + + + + + + + +
+ ); + }; + + const { container, getByRole, rerender } = render(); + + // click submit to trigger validate + fireEvent.click(getByRole('button')); + + await waitFakeTimer(); + expect(container.querySelectorAll('.ant-form-item-explain-error')).toHaveLength(1); + + // When noStyle=true but help is not false, help will be displayed + rerender(); + await waitFakeTimer(); + fireEvent.click(getByRole('button')); + await waitFakeTimer(); + expect(container.querySelectorAll('.ant-form-item-explain-error')).toHaveLength(3); + }); }); it('render functions require either `shouldUpdate` or `dependencies`', () => { @@ -1797,4 +1834,29 @@ describe('Form', () => { expect(onChange).toHaveBeenNthCalledWith(idx++, 'validating'); expect(onChange).toHaveBeenNthCalledWith(idx++, 'success'); }); + + // https://user-images.githubusercontent.com/32004925/230819163-464fe90d-422d-4a6d-9e35-44a25d4c64f1.png + it('should not render `requiredMark` when Form.Item has no required prop', () => { + // Escaping TypeScript error + const genProps = (value: any) => ({ ...value }); + + const { container } = render( +
+ + + + + + +
, + ); + + expect(container.querySelectorAll('.ant-form-item-required')).toHaveLength(2); + expect(container.querySelectorAll('.ant-form-item-required-mark-optional')).toHaveLength(2); + }); }); diff --git a/components/list/__tests__/Item.test.tsx b/components/list/__tests__/Item.test.tsx index 64af9280a7..0c87bc8fab 100644 --- a/components/list/__tests__/Item.test.tsx +++ b/components/list/__tests__/Item.test.tsx @@ -9,7 +9,7 @@ describe('List Item Layout', () => { key: 1, href: 'https://ant.design', title: 'ant design', - avatar: 'https://joesch.moe/api/v1/random', + avatar: 'https://xsgames.co/randomusers/avatar.php?g=pixel', description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.', content: @@ -230,4 +230,20 @@ describe('List Item Layout', () => { rerender(getDom(5)); expect(loadId).toEqual([1, 3, 5]); }); + + it('List.Item.Meta title should have no default margin', () => { + const { container } = render( + ( + + + + )} + />, + ); + + const title = container.querySelector('.ant-list-item-meta-title'); + expect(title && getComputedStyle(title).margin).toEqual('0px 0px 4px 0px'); + }); }); diff --git a/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap index 0d52adf94c..7b0695c856 100644 --- a/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/list/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -26,7 +26,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -63,7 +63,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -100,7 +100,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -137,7 +137,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1360,7 +1360,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1397,7 +1397,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1434,7 +1434,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1471,7 +1471,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -2079,7 +2079,7 @@ exports[`renders components/list/demo/vertical.tsx extend context correctly 1`] class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -2245,7 +2245,7 @@ exports[`renders components/list/demo/vertical.tsx extend context correctly 1`] class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -2411,7 +2411,7 @@ exports[`renders components/list/demo/vertical.tsx extend context correctly 1`] class="ant-avatar ant-avatar-circle ant-avatar-image" > diff --git a/components/list/__tests__/__snapshots__/demo.test.ts.snap b/components/list/__tests__/__snapshots__/demo.test.ts.snap index 117a01e608..d4e9382cc3 100644 --- a/components/list/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/list/__tests__/__snapshots__/demo.test.ts.snap @@ -26,7 +26,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -63,7 +63,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -100,7 +100,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -137,7 +137,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1360,7 +1360,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1397,7 +1397,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1434,7 +1434,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1471,7 +1471,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -2072,7 +2072,7 @@ exports[`renders components/list/demo/vertical.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -2238,7 +2238,7 @@ exports[`renders components/list/demo/vertical.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -2404,7 +2404,7 @@ exports[`renders components/list/demo/vertical.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > diff --git a/components/list/demo/basic.tsx b/components/list/demo/basic.tsx index c4a57e0fc7..ac7ea9519b 100644 --- a/components/list/demo/basic.tsx +++ b/components/list/demo/basic.tsx @@ -23,7 +23,7 @@ const App: React.FC = () => ( renderItem={(item, index) => ( } + avatar={} title={{item.title}} description="Ant Design, a design language for background applications, is refined by Ant UED Team" /> diff --git a/components/list/demo/pagination.tsx b/components/list/demo/pagination.tsx index 6b9740cedc..2040de7ea4 100644 --- a/components/list/demo/pagination.tsx +++ b/components/list/demo/pagination.tsx @@ -70,7 +70,9 @@ const App: React.FC = () => { renderItem={(item, index) => ( } + avatar={ + + } title={{item.title}} description="Ant Design, a design language for background applications, is refined by Ant UED Team" /> diff --git a/components/list/demo/vertical.tsx b/components/list/demo/vertical.tsx index e0e91bcfd3..6236c7cf36 100644 --- a/components/list/demo/vertical.tsx +++ b/components/list/demo/vertical.tsx @@ -5,7 +5,7 @@ import React from 'react'; const data = Array.from({ length: 23 }).map((_, i) => ({ href: 'https://ant.design', title: `ant design part ${i}`, - avatar: `https://joesch.moe/api/v1/random?key=${i}`, + avatar: `https://xsgames.co/randomusers/avatar.php?g=pixel&key=${i}`, description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.', content: diff --git a/components/list/style/index.ts b/components/list/style/index.ts index 9692ac48f9..9a4b9e8160 100644 --- a/components/list/style/index.ts +++ b/components/list/style/index.ts @@ -187,7 +187,7 @@ const genBaseStyle: GenerateStyle = (token) => { }, [`${componentCls}-item-meta-title`]: { - marginBottom: token.marginXXS, + margin: `0 0 ${token.marginXXS}px 0`, color: colorText, fontSize: token.fontSize, lineHeight: token.lineHeight, diff --git a/components/locale/th_TH.ts b/components/locale/th_TH.ts index 0d3f82a269..b85d3dc0b9 100644 --- a/components/locale/th_TH.ts +++ b/components/locale/th_TH.ts @@ -21,9 +21,12 @@ const localeValues: Locale = { filterConfirm: 'ยืนยัน', filterReset: 'รีเซ็ต', filterEmptyText: 'ไม่มีตัวกรอง', + filterCheckall: 'เลือกรายการทั้งหมด', + filterSearchPlaceholder: 'ค้นหาตัวกรอง', emptyText: 'ไม่มีข้อมูล', selectAll: 'เลือกทั้งหมดในหน้านี้', selectInvert: 'กลับสถานะการเลือกในหน้านี้', + selectNone: 'ไม่เลือกข้อมูลทั้งหมด', selectionAll: 'เลือกข้อมูลทั้งหมด', sortTitle: 'เรียง', expand: 'แสดงแถวข้อมูล', @@ -32,6 +35,11 @@ const localeValues: Locale = { triggerAsc: 'คลิกเรียงจากน้อยไปมาก', cancelSort: 'คลิกเพื่อยกเลิกการเรียง', }, + Tour: { + Next: 'ถัดไป', + Previous: 'ย้อนกลับ', + Finish: 'เสร็จสิ้น', + }, Modal: { okText: 'ตกลง', cancelText: 'ยกเลิก', @@ -125,6 +133,13 @@ const localeValues: Locale = { }, }, }, + Image: { + preview: 'ดูตัวอย่าง', + }, + QRCode: { + expired: 'คิวอาร์โค้ดหมดอายุ', + refresh: 'รีเฟรช', + }, }; export default localeValues; diff --git a/components/pagination/style/index.tsx b/components/pagination/style/index.tsx index c1e6078f9b..274c6ed598 100644 --- a/components/pagination/style/index.tsx +++ b/components/pagination/style/index.tsx @@ -98,13 +98,14 @@ const genPaginationDisabledStyle: GenerateStyle = (t [`${componentCls}-item-link`]: { color: token.colorTextDisabled, cursor: 'not-allowed', - '&:hover, &:active': { backgroundColor: 'transparent', }, - [`${componentCls}-simple&`]: { backgroundColor: 'transparent', + '&:hover, &:active': { + backgroundColor: 'transparent', + }, }, }, @@ -120,6 +121,15 @@ const genPaginationDisabledStyle: GenerateStyle = (t color: token.colorTextDisabled, }, }, + [`&${componentCls}-simple`]: { + [`${componentCls}-prev, ${componentCls}-next`]: { + [`&${componentCls}-disabled ${componentCls}-item-link`]: { + '&:hover, &:active': { + backgroundColor: 'transparent', + }, + }, + }, + }, }; }; @@ -224,7 +234,12 @@ const genPaginationSimpleStyle: GenerateStyle = (tok height: token.paginationItemSizeSM, backgroundColor: 'transparent', border: 0, - + '&:hover': { + backgroundColor: token.colorBgTextHover, + }, + '&:active': { + backgroundColor: token.colorBgTextActive, + }, '&::after': { height: token.paginationItemSizeSM, lineHeight: `${token.paginationItemSizeSM}px`, diff --git a/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap b/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap index 63d5ab2cb5..28ae9b5ea1 100644 --- a/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/popconfirm/__tests__/__snapshots__/index.test.tsx.snap @@ -6,4 +6,83 @@ exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"
"`; -exports[`Popconfirm shows content for render functions 1`] = `"
"`; +exports[`Popconfirm shows content for render functions 1`] = ` +
+
+
+ +
+
+`; diff --git a/components/popconfirm/__tests__/index.test.tsx b/components/popconfirm/__tests__/index.test.tsx index 3fd59090f3..f8bc40d6d2 100644 --- a/components/popconfirm/__tests__/index.test.tsx +++ b/components/popconfirm/__tests__/index.test.tsx @@ -3,7 +3,7 @@ import React from 'react'; import Popconfirm from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; -import { render, fireEvent, act, waitFakeTimer } from '../../../tests/utils'; +import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import Button from '../../button'; describe('Popconfirm', () => { @@ -94,7 +94,7 @@ describe('Popconfirm', () => { expect(popconfirm.container.querySelector('.ant-popover')).not.toBe(null); expect(popconfirm.container.querySelector('.ant-popover')?.innerHTML).toContain('some-title'); - expect(popconfirm.container.querySelector('.ant-popover')?.innerHTML).toMatchSnapshot(); + expect(popconfirm.container.querySelector('.ant-popover')).toMatchSnapshot(); }); it('should be controlled by open', () => { diff --git a/components/segmented/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/segmented/__tests__/__snapshots__/demo-extend.test.ts.snap index 486276e316..992d80d6da 100644 --- a/components/segmented/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/segmented/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -330,7 +330,7 @@ exports[`renders components/segmented/demo/custom.tsx extend context correctly 1 class="ant-avatar ant-avatar-circle ant-avatar-image" >
diff --git a/components/segmented/__tests__/__snapshots__/demo.test.ts.snap b/components/segmented/__tests__/__snapshots__/demo.test.ts.snap index 30d9b7deb4..245d41fcc8 100644 --- a/components/segmented/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/segmented/__tests__/__snapshots__/demo.test.ts.snap @@ -330,7 +330,7 @@ exports[`renders components/segmented/demo/custom.tsx correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" >
diff --git a/components/segmented/demo/custom.tsx b/components/segmented/demo/custom.tsx index 4ccba19174..a55e9518b1 100644 --- a/components/segmented/demo/custom.tsx +++ b/components/segmented/demo/custom.tsx @@ -9,7 +9,7 @@ const App: React.FC = () => ( { label: (
- +
User 1
), diff --git a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap index 7e7d72f41d..f497d60695 100644 --- a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -7771,7 +7771,6 @@ exports[`renders components/select/demo/responsive.tsx extend context correctly exports[`renders components/select/demo/search.tsx extend context correctly 1`] = `