chore: auto merge branches (#35922)

chore: Master merge feature
This commit is contained in:
github-actions[bot] 2022-06-06 11:23:19 +00:00 committed by GitHub
commit ae6279a1f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 12 deletions

View File

@ -23,6 +23,7 @@ timeline: true
- 🆕 Tabs support `popupClassName` for more Dropdown. [#35892](https://github.com/ant-design/ant-design/pull/35892)
- 🆕 Table `rowSelection.onChange` support `info.type` param. [#35598](https://github.com/ant-design/ant-design/pull/35598)
- 🆕 The `copyable` prop of Typography.Paragraph supports to reset the mime type of the clipboardData by the `format`. [#35219](https://github.com/ant-design/ant-design/pull/35219) [@kanweiwei](https://github.com/kanweiwei)
- 🆕 TreeSelect support `treeExpandAction`. [#35618](https://github.com/ant-design/ant-design/pull/35618) [@NE-SmallTown](https://github.com/NE-SmallTown)
- ConfigProvider
- 🆕 ConfigProvider support config Pagination `showSizeChanger`. [#35750](https://github.com/ant-design/ant-design/pull/35750)
- 🆕 ConfigProvider support `componentDisabled` to config components `disabled` status. [#35718](https://github.com/ant-design/ant-design/pull/35718)

View File

@ -23,6 +23,7 @@ timeline: true
- 🆕 Tabs 组件支持 `popupClassName` 用于更多菜单。[#35892](https://github.com/ant-design/ant-design/pull/35892)
- 🆕 Table 组件 `rowSelection.onChange` 新增 `info.type` 参数。[#35598](https://github.com/ant-design/ant-design/pull/35598)
- 🆕 Typography.Paragraph 的 `copyable` 属性支持 `format` 以重置剪切板数据的 Mime Type。[#35219](https://github.com/ant-design/ant-design/pull/35219) [@kanweiwei](https://github.com/kanweiwei)
- 🆕 TreeSelect 支持 `treeExpandAction` 定义展开操作。 [#35618](https://github.com/ant-design/ant-design/pull/35618) [@NE-SmallTown](https://github.com/NE-SmallTown)
- ConfigProvider
- 🆕 ConfigProvider 支持全局配置 Pagination `showSizeChanger` 属性。[#35750](https://github.com/ant-design/ant-design/pull/35750)
- 🆕 ConfigProvider 支持 `componentDisabled` 来配置组件禁用状态。[#35718](https://github.com/ant-design/ant-design/pull/35718)

View File

@ -1,12 +1,13 @@
import * as React from 'react';
import classNames from 'classnames';
import isEqual from 'lodash/isEqual';
import type { FieldDataNode } from 'rc-tree';
import FilterFilled from '@ant-design/icons/FilterFilled';
import Button from '../../../button';
import Menu from '../../../menu';
import type { MenuProps } from '../../../menu';
import Tree from '../../../tree';
import type { DataNode, EventDataNode } from '../../../tree';
import type { EventDataNode } from '../../../tree';
import Checkbox from '../../../checkbox';
import type { CheckboxChangeEvent } from '../../../checkbox';
import Radio from '../../../radio';
@ -27,6 +28,8 @@ import { flattenKeys } from '.';
import useSyncState from '../../../_util/hooks/useSyncState';
import { ConfigContext } from '../../../config-provider/context';
type FilterTreeDataNode = FieldDataNode<{ title: React.ReactNode; key: React.Key }>;
interface FilterRestProps {
confirm?: Boolean;
closeDropdown?: Boolean;
@ -160,7 +163,10 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
setFilteredKeysSync(selectedKeys);
};
const onCheck = (keys: Key[], { node, checked }: { node: EventDataNode; checked: boolean }) => {
const onCheck = (
keys: Key[],
{ node, checked }: { node: EventDataNode<FilterTreeDataNode>; checked: boolean },
) => {
if (!filterMultiple) {
onSelectKeys({ selectedKeys: checked && node.key ? [node.key] : [] });
} else {
@ -286,7 +292,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
const getTreeData = ({ filters }: { filters?: ColumnFilterItem[] }) =>
(filters || []).map((filter, index) => {
const key = String(filter.value);
const item: DataNode = {
const item: FilterTreeDataNode = {
title: filter.text,
key: filter.value !== undefined ? key : index,
};
@ -351,7 +357,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
{locale.filterCheckall}
</Checkbox>
) : null}
<Tree
<Tree<FilterTreeDataNode>
checkable
selectable={false}
blockNode

View File

@ -53,6 +53,7 @@ Tree selection control.
| treeDataSimpleMode | Enable simple mode of treeData. Changes the `treeData` schema to: \[{id:1, pId:0, value:'1', title:"test1",...},...] where pId is parent node's id). It is possible to replace the default `id` and `pId` keys by providing object to `treeDataSimpleMode` | boolean \| object&lt;{ id: string, pId: string, rootPId: string }> | false | |
| treeDefaultExpandAll | Whether to expand all treeNodes by default | boolean | false | |
| treeDefaultExpandedKeys | Default expanded treeNodes | string\[] | - | |
| treeExpandAction | Tree title open logic when click, optional: false \| `click` \| `doubleClick` | string \| boolean | false | 4.21.0 |
| treeExpandedKeys | Set expanded keys | string\[] | - | |
| treeIcon | Shows the icon before a TreeNode's title. There is no default style; you must set a custom style for it if set to `true` | boolean | false | |
| treeLoadedKeys | (Controlled) Set loaded tree nodes, work with `loadData` only | string[] | [] | |

View File

@ -77,6 +77,7 @@ const InternalTreeSelect = <OptionType extends BaseOptionType | DefaultOptionTyp
choiceTransitionName = '',
status: customStatus,
showArrow,
treeExpandAction,
...props
}: TreeSelectProps<OptionType>,
ref: React.Ref<BaseSelectRef>,
@ -208,6 +209,7 @@ const InternalTreeSelect = <OptionType extends BaseOptionType | DefaultOptionTyp
transitionName,
)}
showArrow={hasFeedback || showArrow}
treeExpandAction={treeExpandAction}
/>
);
};

View File

@ -54,6 +54,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Ax4DA0njr/TreeSelect.svg
| treeDataSimpleMode | 使用简单格式的 treeData具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: \[{id:1, pId:0, value:'1', title:"test1",...},...] `pId` 是父节点的 id) | boolean \| object&lt;{ id: string, pId: string, rootPId: string }> | false | |
| treeDefaultExpandAll | 默认展开所有树节点 | boolean | false | |
| treeDefaultExpandedKeys | 默认展开的树节点 | string\[] | - | |
| treeExpandAction | 点击节点 title 时的展开逻辑可选false \| `click` \| `doubleClick` | string \| boolean | false | 4.21.0 |
| treeExpandedKeys | 设置展开的树节点 | string\[] | - | |
| treeIcon | 是否展示 TreeNode title 前的图标,没有默认样式,如设置为 true需要自行定义图标相关样式 | boolean | false | |
| treeLine | 是否展示线条样式,请参考 [Tree - showLine](/components/tree/#components-tree-demo-line) | boolean \| object | false | 4.17.0 |

View File

@ -3,6 +3,7 @@ import classNames from 'classnames';
import type RcTree from 'rc-tree';
import debounce from 'lodash/debounce';
import { conductExpandParent } from 'rc-tree/lib/util';
import omit from 'rc-util/lib/omit';
import type { EventDataNode, DataNode, Key } from 'rc-tree/lib/interface';
import { convertDataToEntities, convertTreeToData } from 'rc-tree/lib/utils/treeUtil';
import FileOutlined from '@ant-design/icons/FileOutlined';
@ -104,7 +105,7 @@ const DirectoryTree: React.ForwardRefRenderFunction<RcTree, DirectoryTreeProps>
const onExpand = (
keys: Key[],
info: {
node: EventDataNode;
node: EventDataNode<any>;
expanded: boolean;
nativeEvent: MouseEvent;
},
@ -116,7 +117,7 @@ const DirectoryTree: React.ForwardRefRenderFunction<RcTree, DirectoryTreeProps>
return props.onExpand?.(keys, info);
};
const onClick = (event: React.MouseEvent<HTMLElement>, node: EventDataNode) => {
const onClick = (event: React.MouseEvent<HTMLElement>, node: EventDataNode<any>) => {
const { expandAction } = props;
// Expand the tree
@ -127,7 +128,7 @@ const DirectoryTree: React.ForwardRefRenderFunction<RcTree, DirectoryTreeProps>
props.onClick?.(event, node);
};
const onDoubleClick = (event: React.MouseEvent<HTMLElement>, node: EventDataNode) => {
const onDoubleClick = (event: React.MouseEvent<HTMLElement>, node: EventDataNode<any>) => {
const { expandAction } = props;
// Expand the tree
@ -218,7 +219,7 @@ const DirectoryTree: React.ForwardRefRenderFunction<RcTree, DirectoryTreeProps>
icon={getIcon}
ref={treeRef}
blockNode
{...otherProps}
{...omit(otherProps, ['expandAction'])}
prefixCls={prefixCls}
className={connectClassName}
expandedKeys={expandedKeys}

View File

@ -123,7 +123,7 @@
"lodash": "^4.17.21",
"memoize-one": "^6.0.0",
"moment": "^2.29.2",
"rc-cascader": "~3.5.0",
"rc-cascader": "~3.6.0",
"rc-checkbox": "~2.3.0",
"rc-collapse": "~3.3.0",
"rc-dialog": "~8.8.2",
@ -151,8 +151,8 @@
"rc-tabs": "~11.16.0",
"rc-textarea": "~0.3.0",
"rc-tooltip": "~5.1.1",
"rc-tree": "~5.5.0",
"rc-tree-select": "~5.3.0",
"rc-tree": "~5.6.4",
"rc-tree-select": "~5.4.0",
"rc-trigger": "^5.2.10",
"rc-upload": "~4.3.0",
"rc-util": "^5.20.0",
@ -305,7 +305,7 @@
"bundlesize": [
{
"path": "./dist/antd.min.js",
"maxSize": "282 kB"
"maxSize": "283 kB"
},
{
"path": "./dist/antd.min.css",