chore: auto merge branches (#51570)
Some checks are pending
Publish Any Commit / build (push) Waiting to run
🔀 Sync mirror to Gitee / mirror (push) Waiting to run
✅ test / lint (push) Waiting to run
✅ test / test-react-legacy (16, 1/2) (push) Waiting to run
✅ test / test-react-legacy (16, 2/2) (push) Waiting to run
✅ test / test-react-legacy (17, 1/2) (push) Waiting to run
✅ test / test-react-legacy (17, 2/2) (push) Waiting to run
✅ test / test-node (push) Waiting to run
✅ test / test-react-latest (dom, 1/2) (push) Waiting to run
✅ test / test-react-latest (dom, 2/2) (push) Waiting to run
✅ test / test-react-latest-dist (dist, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist, 2/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Blocked by required conditions
✅ test / test-coverage (push) Blocked by required conditions
✅ test / build (push) Waiting to run
✅ test / test lib/es module (es, 1/2) (push) Waiting to run
✅ test / test lib/es module (es, 2/2) (push) Waiting to run
✅ test / test lib/es module (lib, 1/2) (push) Waiting to run
✅ test / test lib/es module (lib, 2/2) (push) Waiting to run
👁️ Visual Regression Persist Start / test image (push) Waiting to run

chore: sync master to feature
This commit is contained in:
github-actions[bot] 2024-11-11 07:38:47 +00:00 committed by GitHub
commit 0e669d93cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 63 additions and 169 deletions

View File

@ -39,9 +39,9 @@ Common props ref[Common props](/docs/react/common-props)
| Property | Description | Type | Default | Version | | Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| cellRender | Customize cell content | function(current: dayjs, today: dayjs, info: { originNode: React.ReactElement,today: DateType, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 | | cellRender | Customize cell content | function(current: dayjs, info: { prefixCls: string, originNode: React.ReactElement, today: dayjs, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 |
| dateFullCellRender | Customize the display of the date cell, the returned content will override the cell | function(date: Dayjs): ReactNode | - | | | dateFullCellRender | Customize the display of the date cell, the returned content will override the cell | function(date: Dayjs): ReactNode | - | |
| fullCellRender | Customize cell content | function(current: dayjs, today: dayjs, info: { originNode: React.ReactElement,today: DateType, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 | | fullCellRender | Customize cell content | function(current: dayjs, info: { prefixCls: string, originNode: React.ReactElement, today: dayjs, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 |
| defaultValue | The date selected by default | [dayjs](https://day.js.org/) | - | | | defaultValue | The date selected by default | [dayjs](https://day.js.org/) | - | |
| disabledDate | Function that specifies the dates that cannot be selected, `currentDate` is same dayjs object as `value` prop which you shouldn't mutate it](https://github.com/ant-design/ant-design/issues/30987) | (currentDate: Dayjs) => boolean | - | | | disabledDate | Function that specifies the dates that cannot be selected, `currentDate` is same dayjs object as `value` prop which you shouldn't mutate it](https://github.com/ant-design/ant-design/issues/30987) | (currentDate: Dayjs) => boolean | - | |
| fullscreen | Whether to display in full-screen | boolean | true | | | fullscreen | Whether to display in full-screen | boolean | true | |

View File

@ -40,9 +40,9 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*-p-wQLik200AAA
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| cellRender | 自定义单元格的内容 | function(current: dayjs, today: dayjs, info: { originNode: React.ReactElement,today: DateType, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 | | cellRender | 自定义单元格的内容 | function(current: dayjs, info: { prefixCls: string, originNode: React.ReactElement, today: dayjs, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 |
| dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格,>= 5.4.0 请用 `fullCellRender` | function(date: Dayjs): ReactNode | - | < 5.4.0 | | dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格,>= 5.4.0 请用 `fullCellRender` | function(date: Dayjs): ReactNode | - | < 5.4.0 |
| fullCellRender | 自定义单元格的内容 | function(current: dayjs, today: dayjs, info: { originNode: React.ReactElement,today: DateType, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 | | fullCellRender | 自定义单元格的内容 | function(current: dayjs, info: { prefixCls: string, originNode: React.ReactElement, today: dayjs, range?: 'start' \| 'end', type: PanelMode, locale?: Locale, subType?: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 |
| defaultValue | 默认展示的日期 | [dayjs](https://day.js.org/) | - | | | defaultValue | 默认展示的日期 | [dayjs](https://day.js.org/) | - | |
| disabledDate | 不可选择的日期,参数为当前 `value`,注意使用时[不要直接修改](https://github.com/ant-design/ant-design/issues/30987) | (currentDate: Dayjs) => boolean | - | | | disabledDate | 不可选择的日期,参数为当前 `value`,注意使用时[不要直接修改](https://github.com/ant-design/ant-design/issues/30987) | (currentDate: Dayjs) => boolean | - | |
| fullscreen | 是否全屏显示 | boolean | true | | | fullscreen | 是否全屏显示 | boolean | true | |

View File

@ -42577,8 +42577,14 @@ exports[`ConfigProvider components TreeSelect configProvider 1`] = `
> >
<div> <div>
<div> <div>
<span
aria-live="assertive"
style="width: 0px; height: 0px; display: flex; overflow: hidden; opacity: 0; border: 0px; padding: 0px; margin: 0px;"
>
light
</span>
<div <div
class="config-select-tree" class="config-select-tree config-select-tree-active-focused"
role="tree" role="tree"
> >
<div> <div>
@ -42617,7 +42623,7 @@ exports[`ConfigProvider components TreeSelect configProvider 1`] = `
> >
<div <div
aria-grabbed="false" aria-grabbed="false"
class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-leaf-last" class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-active config-select-tree-treenode-leaf-last"
draggable="false" draggable="false"
> >
<span <span
@ -42781,8 +42787,14 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize large
> >
<div> <div>
<div> <div>
<span
aria-live="assertive"
style="width: 0px; height: 0px; display: flex; overflow: hidden; opacity: 0; border: 0px; padding: 0px; margin: 0px;"
>
light
</span>
<div <div
class="config-select-tree" class="config-select-tree config-select-tree-active-focused"
role="tree" role="tree"
> >
<div> <div>
@ -42821,7 +42833,7 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize large
> >
<div <div
aria-grabbed="false" aria-grabbed="false"
class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-leaf-last" class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-active config-select-tree-treenode-leaf-last"
draggable="false" draggable="false"
> >
<span <span
@ -42920,8 +42932,14 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize middl
> >
<div> <div>
<div> <div>
<span
aria-live="assertive"
style="width: 0px; height: 0px; display: flex; overflow: hidden; opacity: 0; border: 0px; padding: 0px; margin: 0px;"
>
light
</span>
<div <div
class="config-select-tree" class="config-select-tree config-select-tree-active-focused"
role="tree" role="tree"
> >
<div> <div>
@ -42960,7 +42978,7 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize middl
> >
<div <div
aria-grabbed="false" aria-grabbed="false"
class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-leaf-last" class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-active config-select-tree-treenode-leaf-last"
draggable="false" draggable="false"
> >
<span <span
@ -43059,8 +43077,14 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize small
> >
<div> <div>
<div> <div>
<span
aria-live="assertive"
style="width: 0px; height: 0px; display: flex; overflow: hidden; opacity: 0; border: 0px; padding: 0px; margin: 0px;"
>
light
</span>
<div <div
class="config-select-tree" class="config-select-tree config-select-tree-active-focused"
role="tree" role="tree"
> >
<div> <div>
@ -43099,7 +43123,7 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize small
> >
<div <div
aria-grabbed="false" aria-grabbed="false"
class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-leaf-last" class="config-select-tree-treenode config-select-tree-treenode-switcher-close config-select-tree-treenode-active config-select-tree-treenode-leaf-last"
draggable="false" draggable="false"
> >
<span <span
@ -43198,8 +43222,14 @@ exports[`ConfigProvider components TreeSelect normal 1`] = `
> >
<div> <div>
<div> <div>
<span
aria-live="assertive"
style="width: 0px; height: 0px; display: flex; overflow: hidden; opacity: 0; border: 0px; padding: 0px; margin: 0px;"
>
light
</span>
<div <div
class="ant-select-tree" class="ant-select-tree ant-select-tree-active-focused"
role="tree" role="tree"
> >
<div> <div>
@ -43238,7 +43268,7 @@ exports[`ConfigProvider components TreeSelect normal 1`] = `
> >
<div <div
aria-grabbed="false" aria-grabbed="false"
class="ant-select-tree-treenode ant-select-tree-treenode-switcher-close ant-select-tree-treenode-leaf-last" class="ant-select-tree-treenode ant-select-tree-treenode-switcher-close ant-select-tree-treenode-active ant-select-tree-treenode-leaf-last"
draggable="false" draggable="false"
> >
<span <span
@ -43337,8 +43367,14 @@ exports[`ConfigProvider components TreeSelect prefixCls 1`] = `
> >
<div> <div>
<div> <div>
<span
aria-live="assertive"
style="width: 0px; height: 0px; display: flex; overflow: hidden; opacity: 0; border: 0px; padding: 0px; margin: 0px;"
>
light
</span>
<div <div
class="prefix-TreeSelect-tree" class="prefix-TreeSelect-tree prefix-TreeSelect-tree-active-focused"
role="tree" role="tree"
> >
<div> <div>
@ -43377,7 +43413,7 @@ exports[`ConfigProvider components TreeSelect prefixCls 1`] = `
> >
<div <div
aria-grabbed="false" aria-grabbed="false"
class="prefix-TreeSelect-tree-treenode prefix-TreeSelect-tree-treenode-switcher-close prefix-TreeSelect-tree-treenode-leaf-last" class="prefix-TreeSelect-tree-treenode prefix-TreeSelect-tree-treenode-switcher-close prefix-TreeSelect-tree-treenode-active prefix-TreeSelect-tree-treenode-leaf-last"
draggable="false" draggable="false"
> >
<span <span

View File

@ -1,151 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`TreeSelect TreeSelect Custom Icons should \`treeIcon\` work 1`] = `
<div
class="ant-select ant-tree-select ant-select-outlined ant-select-single ant-select-show-arrow ant-select-open"
>
<div
class="ant-select-selector"
>
<span
class="ant-select-selection-wrap"
>
<span
class="ant-select-selection-search"
>
<input
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="true"
aria-haspopup="listbox"
aria-owns="rc_select_TEST_OR_SSR_list"
autocomplete="off"
class="ant-select-selection-search-input"
id="rc_select_TEST_OR_SSR"
readonly=""
role="combobox"
style="opacity: 0;"
type="search"
unselectable="on"
value=""
/>
</span>
<span
class="ant-select-selection-placeholder"
/>
</span>
</div>
<div
class="ant-select-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up ant-tree-select-dropdown ant-select-dropdown-placement-bottomLeft"
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; box-sizing: border-box;"
>
<div>
<div>
<div
class="ant-select-tree"
role="tree"
>
<div>
<input
aria-label="for screen reader"
disabled=""
style="width: 0px; height: 0px; display: flex; overflow: hidden; opacity: 0; border: 0px; padding: 0px; margin: 0px;"
value=""
/>
</div>
<div
aria-hidden="true"
class="ant-select-tree-treenode"
style="position: absolute; pointer-events: none; visibility: hidden; height: 0px; overflow: hidden; border: 0px; padding: 0px;"
>
<div
class="ant-select-tree-indent"
>
<div
class="ant-select-tree-indent-unit"
/>
</div>
</div>
<div
class="ant-select-tree-list"
style="position: relative;"
>
<div
class="ant-select-tree-list-holder"
style="max-height: 256px; overflow-y: auto;"
>
<div>
<div
class="ant-select-tree-list-holder-inner"
style="display: flex; flex-direction: column;"
>
<div
aria-grabbed="false"
class="ant-select-tree-treenode ant-select-tree-treenode-switcher-close ant-select-tree-treenode-leaf-last"
draggable="false"
>
<span
aria-hidden="true"
class="ant-select-tree-indent"
/>
<span
class="ant-select-tree-switcher ant-select-tree-switcher-noop"
/>
<span
class="ant-select-tree-node-content-wrapper ant-select-tree-node-content-wrapper-normal"
title="parent 1"
>
<span
class="ant-select-tree-iconEle ant-select-tree-icon__customize"
>
<span>
Bamboo
</span>
</span>
<span
class="ant-select-tree-title"
>
parent 1
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<span
aria-hidden="true"
class="ant-select-arrow"
style="user-select: none;"
unselectable="on"
>
<span
aria-label="down"
class="anticon anticon-down ant-select-suffix"
role="img"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
</div>
`;
exports[`TreeSelect TreeSelect Custom Icons should support customized icons 1`] = ` exports[`TreeSelect TreeSelect Custom Icons should support customized icons 1`] = `
<div <div
class="ant-select ant-tree-select ant-select-outlined ant-select-multiple ant-select-allow-clear ant-select-show-arrow ant-select-show-search" class="ant-select ant-tree-select ant-select-outlined ant-select-multiple ant-select-allow-clear ant-select-show-arrow ant-select-show-search"

View File

@ -40,11 +40,11 @@ describe('TreeSelect', () => {
it('should `treeIcon` work', () => { it('should `treeIcon` work', () => {
const { container } = render( const { container } = render(
<TreeSelect treeIcon open> <TreeSelect treeIcon open>
<TreeNode value="parent 1" title="parent 1" icon={<span>Bamboo</span>} /> <TreeNode value="parent 1" title="parent 1" icon={<span className="bamboo" />} />
</TreeSelect>, </TreeSelect>,
); );
expect(container.firstChild).toMatchSnapshot(); expect(container.querySelector('.ant-select-tree-treenode .bamboo')).toBeTruthy();
}); });
}); });

View File

@ -31,6 +31,7 @@ import { useCompactItemContext } from '../space/Compact';
import type { AntTreeNodeProps, TreeProps } from '../tree'; import type { AntTreeNodeProps, TreeProps } from '../tree';
import type { SwitcherIcon } from '../tree/Tree'; import type { SwitcherIcon } from '../tree/Tree';
import SwitcherIconCom from '../tree/utils/iconUtil'; import SwitcherIconCom from '../tree/utils/iconUtil';
import { useToken } from '../theme/internal';
import useStyle from './style'; import useStyle from './style';
type RawValue = string | number; type RawValue = string | number;
@ -97,7 +98,7 @@ const InternalTreeSelect = <ValueType = any, OptionType extends DataNode = DataN
treeCheckable, treeCheckable,
multiple, multiple,
listHeight = 256, listHeight = 256,
listItemHeight = 26, listItemHeight: customListItemHeight,
placement, placement,
notFoundContent, notFoundContent,
switcherIcon, switcherIcon,
@ -129,6 +130,9 @@ const InternalTreeSelect = <ValueType = any, OptionType extends DataNode = DataN
popupOverflow, popupOverflow,
} = React.useContext(ConfigContext); } = React.useContext(ConfigContext);
const [, token] = useToken();
const listItemHeight = customListItemHeight ?? token?.controlHeightSM + token?.paddingXXS;
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('TreeSelect'); const warning = devUseWarning('TreeSelect');

View File

@ -135,12 +135,12 @@
"rc-motion": "^2.9.3", "rc-motion": "^2.9.3",
"rc-notification": "~5.6.2", "rc-notification": "~5.6.2",
"rc-pagination": "~4.3.0", "rc-pagination": "~4.3.0",
"rc-picker": "~4.7.0", "rc-picker": "~4.7.2",
"rc-progress": "~4.0.0", "rc-progress": "~4.0.0",
"rc-rate": "~2.13.0", "rc-rate": "~2.13.0",
"rc-resize-observer": "^1.4.0", "rc-resize-observer": "^1.4.0",
"rc-segmented": "~2.5.0", "rc-segmented": "~2.5.0",
"rc-select": "~14.16.2", "rc-select": "~14.16.3",
"rc-slider": "~11.1.7", "rc-slider": "~11.1.7",
"rc-steps": "~6.0.1", "rc-steps": "~6.0.1",
"rc-switch": "~4.1.0", "rc-switch": "~4.1.0",
@ -149,7 +149,7 @@
"rc-textarea": "~1.8.2", "rc-textarea": "~1.8.2",
"rc-tooltip": "~6.2.1", "rc-tooltip": "~6.2.1",
"rc-tree": "~5.10.1", "rc-tree": "~5.10.1",
"rc-tree-select": "~5.24.2", "rc-tree-select": "~5.24.3",
"rc-upload": "~4.8.1", "rc-upload": "~4.8.1",
"rc-util": "^5.43.0", "rc-util": "^5.43.0",
"scroll-into-view-if-needed": "^3.1.0", "scroll-into-view-if-needed": "^3.1.0",
@ -283,7 +283,7 @@
"qs": "^6.13.0", "qs": "^6.13.0",
"rc-footer": "^0.6.8", "rc-footer": "^0.6.8",
"rc-tween-one": "^3.0.6", "rc-tween-one": "^3.0.6",
"rc-virtual-list": "^3.14.8", "rc-virtual-list": "^3.15.0",
"react": "^18.3.1", "react": "^18.3.1",
"react-copy-to-clipboard": "^5.1.0", "react-copy-to-clipboard": "^5.1.0",
"react-countup": "^6.5.3", "react-countup": "^6.5.3",