From a5649f16953197357de8aae4b35e7d4c13663b21 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: Tue, 14 Nov 2023 11:01:49 +0800 Subject: [PATCH 1/4] chore: bump table (#45857) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c641b6c2d025..2be511342756 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "rc-slider": "~10.4.0", "rc-steps": "~6.0.1", "rc-switch": "~4.1.0", - "rc-table": "~7.35.2", + "rc-table": "~7.36.0", "rc-tabs": "~12.13.1", "rc-textarea": "~1.5.3", "rc-tooltip": "~6.1.2", From 2777d2c39f7894b48d79bd1d0f764acb0ac23c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kiner-tang=28=E6=96=87=E8=BE=89=29?= <1127031143@qq.com> Date: Tue, 14 Nov 2023 18:01:23 +0800 Subject: [PATCH 2/4] fix: Fixed an issue where the z-index setting of the pop-up component was abnormal in the pop-up container (#45864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Fixed an issue where the z-index setting of the pop-up component was abnormal in the pop-up container * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * Update components/popconfirm/index.tsx Signed-off-by: kiner-tang(文辉) <1127031143@qq.com> --------- Signed-off-by: kiner-tang(文辉) <1127031143@qq.com> --- components/_util/__tests__/useZIndex.test.tsx | 25 +++++++++++++------ components/_util/hooks/useZIndex.tsx | 3 +-- components/color-picker/ColorPicker.tsx | 3 --- .../__snapshots__/demo-extend.test.ts.snap | 2 +- components/popover/index.tsx | 2 -- components/tooltip/index.tsx | 2 +- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/components/_util/__tests__/useZIndex.test.tsx b/components/_util/__tests__/useZIndex.test.tsx index cf8382dc2982..eb5062efb373 100644 --- a/components/_util/__tests__/useZIndex.test.tsx +++ b/components/_util/__tests__/useZIndex.test.tsx @@ -150,6 +150,7 @@ const consumerComponent: Record + ), Dropdown: (props) => ( @@ -166,7 +167,6 @@ const consumerComponent: Recordtest ), - ColorPicker: (props) => , DatePicker: ({ rootClassName, ...props }) => ( <> @@ -183,8 +183,12 @@ const consumerComponent: Record `${baseSelector}.comp-${item}.ant-slide-up`) + selector = ['Select', 'Cascader', 'TreeSelect', 'AutoComplete', 'ColorPicker'] + .map((item) => + item === 'ColorPicker' + ? `${baseSelector}.ant-popover-placement-bottomLeft` + : `${baseSelector}.comp-${item}.ant-slide-up`, + ) .join(','); } else if (consumer === 'DatePicker') { selector = ['DatePicker', 'TimePicker'] @@ -192,8 +196,6 @@ function getConsumerSelector(baseSelector: string, consumer: ZIndexConsumer): st .join(','); } else if (['Menu'].includes(consumer)) { selector = `${baseSelector}.ant-menu-submenu-placement-rightTop`; - } else if (consumer === 'ColorPicker') { - selector = `${baseSelector}.ant-popover-placement-bottomLeft`; } return selector; } @@ -268,21 +270,29 @@ describe('Test useZIndex hooks', () => { }); comps = document.querySelectorAll(selector2); comps.forEach((comp) => { + const isColorPicker = (comp as HTMLDivElement).className.includes('comp-ColorPicker'); + const consumerOffset = isColorPicker + ? 1000 + containerBaseZIndexOffset.Popover + : consumerBaseZIndexOffset[key as ZIndexConsumer]; expect((comp as HTMLDivElement).style.zIndex).toBe( String( 1000 + containerBaseZIndexOffset[containerKey as ZIndexContainer] + - consumerBaseZIndexOffset[key as ZIndexConsumer], + consumerOffset, ), ); }); comps = document.querySelectorAll(selector3); comps.forEach((comp) => { + const isColorPicker = (comp as HTMLDivElement).className.includes('comp-ColorPicker'); + const consumerOffset = isColorPicker + ? 1000 + containerBaseZIndexOffset.Popover + : consumerBaseZIndexOffset[key as ZIndexConsumer]; expect((comp as HTMLDivElement).style.zIndex).toBe( String( (1000 + containerBaseZIndexOffset[containerKey as ZIndexContainer]) * 2 + - consumerBaseZIndexOffset[key as ZIndexConsumer], + consumerOffset, ), ); }); @@ -296,6 +306,7 @@ describe('Test useZIndex hooks', () => { (document.querySelector(selector1) as HTMLDivElement).style.zIndex, ).toBeFalsy(); } + expect((document.querySelector(selector2) as HTMLDivElement).style.zIndex).toBe( String( 1000 + diff --git a/components/_util/hooks/useZIndex.tsx b/components/_util/hooks/useZIndex.tsx index cc0124431202..be90054cf4fc 100644 --- a/components/_util/hooks/useZIndex.tsx +++ b/components/_util/hooks/useZIndex.tsx @@ -5,7 +5,7 @@ import zIndexContext from '../zindexContext'; export type ZIndexContainer = 'Modal' | 'Drawer' | 'Popover' | 'Popconfirm' | 'Tooltip' | 'Tour'; -export type ZIndexConsumer = 'SelectLike' | 'Dropdown' | 'ColorPicker' | 'DatePicker' | 'Menu'; +export type ZIndexConsumer = 'SelectLike' | 'Dropdown' | 'DatePicker' | 'Menu'; export const containerBaseZIndexOffset: Record = { Modal: 0, @@ -18,7 +18,6 @@ export const containerBaseZIndexOffset: Record = { export const consumerBaseZIndexOffset: Record = { SelectLike: 50, Dropdown: 50, - ColorPicker: 30, DatePicker: 50, Menu: 50, }; diff --git a/components/color-picker/ColorPicker.tsx b/components/color-picker/ColorPicker.tsx index 0d3124b7a21c..d6f9c79f3ce9 100644 --- a/components/color-picker/ColorPicker.tsx +++ b/components/color-picker/ColorPicker.tsx @@ -32,7 +32,6 @@ import type { } from './interface'; import useStyle from './style/index'; import { customizePrefixCls, genAlphaColor, generateColor, getAlphaColor } from './util'; -import { useZIndex } from '../_util/hooks/useZIndex'; export type ColorPickerProps = Omit< RcColorPickerProps, @@ -232,7 +231,6 @@ const ColorPicker: CompoundedComponent = (props) => { const mergedStyle: React.CSSProperties = { ...colorPicker?.style, ...style }; // ============================ zIndex ============================ - const [zIndex] = useZIndex('ColorPicker'); return wrapSSR( { } overlayClassName={mergePopupCls} - zIndex={zIndex} {...popoverProps} > {children || ( diff --git a/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap index 3bf41e09c374..0ae0d9065693 100644 --- a/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -813,7 +813,7 @@ Array [ ,
((props, ref) => { const overlayCls = classNames(overlayClassName, hashId); - // ============================ zIndex ============================ - return wrapSSR( ((props, ref) => { const content = ( Date: Tue, 14 Nov 2023 19:40:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?docs(=F0=9F=93=96):=20update=20tabs=20compo?= =?UTF-8?q?nent=20docs=20(#45875)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📖docs: update tabs component docs * Update components/tabs/index.zh-CN.md Co-authored-by: afc163 Signed-off-by: yufamg <99855951+yufamg@users.noreply.github.com> * Update components/tabs/index.en-US.md Co-authored-by: afc163 Signed-off-by: yufamg <99855951+yufamg@users.noreply.github.com> --------- Signed-off-by: yufamg <99855951+yufamg@users.noreply.github.com> Co-authored-by: afc163 --- components/tabs/index.en-US.md | 1 + components/tabs/index.zh-CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/components/tabs/index.en-US.md b/components/tabs/index.en-US.md index 407165374564..009848a7bf54 100644 --- a/components/tabs/index.en-US.md +++ b/components/tabs/index.en-US.md @@ -83,6 +83,7 @@ More option at [rc-tabs tabs](https://github.com/react-component/tabs#tabs) | key | TabPane's key | string | - | | | label | TabPane's head display text | ReactNode | - | | | children | TabPane's head display content | ReactNode | - | | +| closable | Whether a close (x) button is visible, Only works while `type="editable-card"` | boolean | true | | ## Design Token diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md index 35cd9d4404fc..273fc46fe9bf 100644 --- a/components/tabs/index.zh-CN.md +++ b/components/tabs/index.zh-CN.md @@ -85,6 +85,7 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | key | 对应 activeKey | string | - | | | label | 选项卡头显示文字 | ReactNode | - | | | children | 选项卡头显示内容 | ReactNode | - | | +| closable | 是否显示选项卡的关闭按钮,在 `type="editable-card"` 时有效 | boolean | true | | ## 主题变量(Design Token) From ab4863cce760fec9c9bcfa390ce5e315f37ae967 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:37:26 +0800 Subject: [PATCH 4/4] chore(deps-dev): bump size-limit from 10.0.3 to 11.0.0 (#45877) * chore(deps-dev): bump size-limit from 10.0.3 to 11.0.0 Bumps [size-limit](https://github.com/ai/size-limit) from 10.0.3 to 11.0.0. - [Changelog](https://github.com/ai/size-limit/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/size-limit/compare/10.0.3...11.0.0) --- updated-dependencies: - dependency-name: size-limit dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update package.json Signed-off-by: afc163 --------- Signed-off-by: dependabot[bot] Signed-off-by: afc163 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: afc163 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2be511342756..15eab801f50d 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "@emotion/server": "^11.4.0", "@ianvs/prettier-plugin-sort-imports": "^4.1.0", "@qixian.cs/github-contributors-list": "^1.1.0", - "@size-limit/file": "^10.0.0", + "@size-limit/file": "^11.0.0", "@stackblitz/sdk": "^1.3.0", "@testing-library/dom": "^9.0.0", "@testing-library/jest-dom": "^6.0.0", @@ -299,7 +299,7 @@ "runes2": "^1.1.2", "semver": "^7.3.5", "simple-git": "^3.0.0", - "size-limit": "^10.0.0", + "size-limit": "^11.0.0", "stylelint": "^15.1.0", "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard": "^34.0.0",