): React.ReactElemen
'colon',
'extra',
'fieldKey',
+ 'requiredMark',
'getValueFromEvent',
'getValueProps',
'htmlFor',
diff --git a/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
index 2f47644a7115..2771c012d98d 100644
--- a/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
+++ b/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
@@ -18730,6 +18730,1234 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc
+
diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap
index 81ad892d2ebc..8b3a0b366faf 100644
--- a/components/form/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/form/__tests__/__snapshots__/demo.test.js.snap
@@ -7872,6 +7872,137 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
+
`;
-exports[`renders ./components/list/demo/resposive.md extend context correctly 1`] = `
+exports[`renders ./components/list/demo/responsive.md extend context correctly 1`] = `
diff --git a/components/list/__tests__/__snapshots__/demo.test.js.snap b/components/list/__tests__/__snapshots__/demo.test.js.snap
index ccd8ee0a13da..b2fec35f0679 100644
--- a/components/list/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/list/__tests__/__snapshots__/demo.test.js.snap
@@ -1165,7 +1165,7 @@ exports[`renders ./components/list/demo/loadmore.md correctly 1`] = `
`;
-exports[`renders ./components/list/demo/resposive.md correctly 1`] = `
+exports[`renders ./components/list/demo/responsive.md correctly 1`] = `
diff --git a/components/list/demo/resposive.md b/components/list/demo/responsive.md
similarity index 100%
rename from components/list/demo/resposive.md
rename to components/list/demo/responsive.md
diff --git a/components/locale/it_IT.tsx b/components/locale/it_IT.tsx
index a22dbca30100..17a64c0823c1 100644
--- a/components/locale/it_IT.tsx
+++ b/components/locale/it_IT.tsx
@@ -17,6 +17,8 @@ const localeValues: Locale = {
filterTitle: 'Menù Filtro',
filterConfirm: 'OK',
filterReset: 'Reset',
+ selectNone: 'Deseleziona tutto',
+ selectionAll: 'Seleziona tutto',
selectAll: 'Seleziona pagina corrente',
selectInvert: 'Inverti selezione nella pagina corrente',
sortTitle: 'Ordina',
diff --git a/components/locale/lt_LT.tsx b/components/locale/lt_LT.tsx
index 857d6ffda5b6..0573b87718e0 100644
--- a/components/locale/lt_LT.tsx
+++ b/components/locale/lt_LT.tsx
@@ -6,7 +6,7 @@ import TimePicker from '../time-picker/locale/lt_LT';
import Calendar from '../calendar/locale/lt_LT';
import { Locale } from '../locale-provider';
-const typeTemplate: string = '${label} не является типом ${type}';
+const typeTemplate: string = '${label} neatitinka tipo ${type}';
const localeValues: Locale = {
locale: 'lt',
diff --git a/components/menu/index.tsx b/components/menu/index.tsx
index e951714e380e..9d5602367d89 100644
--- a/components/menu/index.tsx
+++ b/components/menu/index.tsx
@@ -3,15 +3,14 @@ import RcMenu, { ItemGroup, MenuProps as RcMenuProps } from 'rc-menu';
import classNames from 'classnames';
import omit from 'rc-util/lib/omit';
import { EllipsisOutlined } from 'infra-design-icons';
-import memoize from 'memoize-one';
import SubMenu, { SubMenuProps } from './SubMenu';
import Item, { MenuItemProps } from './MenuItem';
-import { ConfigConsumer, ConfigConsumerProps, DirectionType } from '../config-provider';
+import { ConfigContext } from '../config-provider';
import devWarning from '../_util/devWarning';
import { SiderContext, SiderContextProps } from '../layout/Sider';
import collapseMotion from '../_util/motion';
import { cloneElement } from '../_util/reactNode';
-import MenuContext, { MenuTheme, MenuContextProps } from './MenuContext';
+import MenuContext, { MenuTheme } from './MenuContext';
import MenuDivider from './MenuDivider';
export { MenuDividerProps } from './MenuDivider';
@@ -37,108 +36,87 @@ type InternalMenuProps = MenuProps &
collapsedWidth?: string | number;
};
-class InternalMenu extends React.Component {
- static defaultProps: Partial = {
- theme: 'light', // or dark
- };
-
- constructor(props: InternalMenuProps) {
- super(props);
-
- devWarning(
- !('inlineCollapsed' in props && props.mode !== 'inline'),
- 'Menu',
- '`inlineCollapsed` should only be used when `mode` is inline.',
- );
+function InternalMenu(props: InternalMenuProps) {
+ const { getPrefixCls, getPopupContainer, direction } = React.useContext(ConfigContext);
+
+ const rootPrefixCls = getPrefixCls();
+
+ const {
+ prefixCls: customizePrefixCls,
+ className,
+ theme = 'light',
+ expandIcon,
+ _internalDisableMenuItemTitleTooltip,
+ inlineCollapsed,
+ siderCollapsed,
+ ...restProps
+ } = props;
+
+ const passedProps = omit(restProps, ['collapsedWidth']);
+
+ // ======================== Warning ==========================
+ devWarning(
+ !('inlineCollapsed' in props && props.mode !== 'inline'),
+ 'Menu',
+ '`inlineCollapsed` should only be used when `mode` is inline.',
+ );
- devWarning(
- !(props.siderCollapsed !== undefined && 'inlineCollapsed' in props),
- 'Menu',
- '`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.',
- );
- }
+ devWarning(
+ !(props.siderCollapsed !== undefined && 'inlineCollapsed' in props),
+ 'Menu',
+ '`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.',
+ );
- getInlineCollapsed() {
- const { inlineCollapsed, siderCollapsed } = this.props;
+ // ======================== Collapsed ========================
+ // Inline Collapsed
+ const mergedInlineCollapsed = React.useMemo(() => {
if (siderCollapsed !== undefined) {
return siderCollapsed;
}
return inlineCollapsed;
- }
-
- getMemoizedContextValue = memoize(
- (
- cls: string,
- collapsed: boolean | undefined,
- the: MenuTheme | undefined,
- dir: DirectionType,
- disableMenuItemTitleTooltip: boolean | undefined,
- ): MenuContextProps => ({
- prefixCls: cls,
- inlineCollapsed: collapsed || false,
- antdMenuTheme: the,
- direction: dir,
- firstLevel: true,
- disableMenuItemTitleTooltip,
- }),
- );
-
- renderMenu = ({ getPopupContainer, getPrefixCls, direction }: ConfigConsumerProps) => {
- const rootPrefixCls = getPrefixCls();
+ }, [inlineCollapsed, siderCollapsed]);
- const {
- prefixCls: customizePrefixCls,
- className,
- theme,
- expandIcon,
- _internalDisableMenuItemTitleTooltip,
- ...restProps
- } = this.props;
-
- const passedProps = omit(restProps, ['siderCollapsed', 'collapsedWidth']);
- const inlineCollapsed = this.getInlineCollapsed();
-
- const defaultMotions = {
- horizontal: { motionName: `${rootPrefixCls}-slide-up` },
- inline: collapseMotion,
- other: { motionName: `${rootPrefixCls}-zoom-big` },
- };
+ const defaultMotions = {
+ horizontal: { motionName: `${rootPrefixCls}-slide-up` },
+ inline: collapseMotion,
+ other: { motionName: `${rootPrefixCls}-zoom-big` },
+ };
- const prefixCls = getPrefixCls('menu', customizePrefixCls);
- const menuClassName = classNames(`${prefixCls}-${theme}`, className);
+ const prefixCls = getPrefixCls('menu', customizePrefixCls);
+ const menuClassName = classNames(`${prefixCls}-${theme}`, className);
- // TODO: refactor menu with function component
- const contextValue = this.getMemoizedContextValue(
+ // ======================== Context ==========================
+ const contextValue = React.useMemo(
+ () => ({
prefixCls,
- inlineCollapsed,
- theme,
+ inlineCollapsed: mergedInlineCollapsed || false,
+ antdMenuTheme: theme,
direction,
- _internalDisableMenuItemTitleTooltip,
- );
-
- return (
-
- }
- overflowedIndicatorPopupClassName={`${prefixCls}-${theme}`}
- {...passedProps}
- inlineCollapsed={inlineCollapsed}
- className={menuClassName}
- prefixCls={prefixCls}
- direction={direction}
- defaultMotions={defaultMotions}
- expandIcon={cloneElement(expandIcon, {
- className: `${prefixCls}-submenu-expand-icon`,
- })}
- />
-
- );
- };
+ firstLevel: true,
+ disableMenuItemTitleTooltip: _internalDisableMenuItemTitleTooltip,
+ }),
+ [prefixCls, mergedInlineCollapsed, theme, direction, _internalDisableMenuItemTitleTooltip],
+ );
- render() {
- return {this.renderMenu};
- }
+ // ========================= Render ==========================
+ return (
+
+ }
+ overflowedIndicatorPopupClassName={`${prefixCls}-${theme}`}
+ {...passedProps}
+ inlineCollapsed={mergedInlineCollapsed}
+ className={menuClassName}
+ prefixCls={prefixCls}
+ direction={direction}
+ defaultMotions={defaultMotions}
+ expandIcon={cloneElement(expandIcon, {
+ className: `${prefixCls}-submenu-expand-icon`,
+ })}
+ />
+
+ );
}
// We should keep this as ref-able
diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx
index 9989eb8bd0c3..5af8e4966494 100644
--- a/components/modal/Modal.tsx
+++ b/components/modal/Modal.tsx
@@ -2,6 +2,7 @@ import * as React from 'react';
import Dialog from 'rc-dialog';
import classNames from 'classnames';
import { CloseOutlined } from 'infra-design-icons';
+
import { getConfirmLocale } from './locale';
import Button from '../button';
import { LegacyButtonType, ButtonProps, convertLegacyProps } from '../button/button';
diff --git a/components/page-header/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/page-header/__tests__/__snapshots__/demo-extend.test.ts.snap
index 62f8cbc4aaef..9a8ff8de4266 100644
--- a/components/page-header/__tests__/__snapshots__/demo-extend.test.ts.snap
+++ b/components/page-header/__tests__/__snapshots__/demo-extend.test.ts.snap
@@ -58,30 +58,48 @@ Array [
);
};
@@ -120,12 +125,9 @@ const renderChildren = (prefixCls: string, children: React.ReactNode) => (
);
const PageHeader: React.FC = props => {
- const [compact, updateCompact] = React.useState(false);
- const isDestroyed = useDestroyed();
+ const [compact, updateCompact] = useState(false);
const onResize = ({ width }: { width: number }) => {
- if (!isDestroyed()) {
- updateCompact(width < 768);
- }
+ updateCompact(width < 768, true);
};
return (
diff --git a/components/page-header/style/index.less b/components/page-header/style/index.less
index 6eeedec96f70..074145756ce1 100644
--- a/components/page-header/style/index.less
+++ b/components/page-header/style/index.less
@@ -87,13 +87,8 @@
white-space: nowrap;
> * {
- margin-left: @margin-sm;
white-space: unset;
}
-
- > *:first-child {
- margin-left: 0;
- }
}
}
diff --git a/components/page-header/style/index.tsx b/components/page-header/style/index.tsx
index 8ca5d47ad6ac..cd4e5ba32dde 100644
--- a/components/page-header/style/index.tsx
+++ b/components/page-header/style/index.tsx
@@ -3,3 +3,4 @@ import './index.less';
// style dependencies
import '../../breadcrumb/style';
import '../../avatar/style';
+import '../../space/style';
diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx
index b55a77df766f..1ed9b723463b 100644
--- a/components/popconfirm/index.tsx
+++ b/components/popconfirm/index.tsx
@@ -13,7 +13,6 @@ import { getRenderPropValue, RenderFunction } from '../_util/getRenderPropValue'
import { cloneElement } from '../_util/reactNode';
import { getTransitionName } from '../_util/motion';
import ActionButton from '../_util/ActionButton';
-import useDestroyed from '../_util/hooks/useDestroyed';
export interface PopconfirmProps extends AbstractTooltipProps {
title: React.ReactNode | RenderFunction;
@@ -49,15 +48,13 @@ const Popconfirm = React.forwardRef((props, ref) => {
defaultValue: props.defaultVisible,
});
- const isDestroyed = useDestroyed();
+ // const isDestroyed = useDestroyed();
const settingVisible = (
value: boolean,
e?: React.MouseEvent | React.KeyboardEvent,
) => {
- if (!isDestroyed()) {
- setVisible(value);
- }
+ setVisible(value, true);
props.onVisibleChange?.(value, e);
};
diff --git a/components/rate/style/index.less b/components/rate/style/index.less
index 7b5dad79ee0c..56a274b1bf41 100644
--- a/components/rate/style/index.less
+++ b/components/rate/style/index.less
@@ -18,7 +18,7 @@
&-disabled &-star {
cursor: default;
- &:hover {
+ > div:hover {
transform: scale(1);
}
}
diff --git a/components/select/demo/custom-dropdown-menu.md b/components/select/demo/custom-dropdown-menu.md
index 9028c2fd8640..499585b02585 100644
--- a/components/select/demo/custom-dropdown-menu.md
+++ b/components/select/demo/custom-dropdown-menu.md
@@ -7,11 +7,11 @@ title:
## zh-CN
-使用 `dropdownRender` 对下拉菜单进行自由扩展。
+使用 `dropdownRender` 对下拉菜单进行自由扩展。自定义内容点击时会关闭浮层,如果不喜欢关闭,可以添加 `onMouseDown={e => e.preventDefault()}` 进行阻止(更多详情见 [#13448](https://github.com/ant-design/ant-design/issues/13448))。
## en-US
-Customize the dropdown menu via `dropdownRender`.
+Customize the dropdown menu via `dropdownRender`. Dropdown menu will be closed if click `dropdownRender` area, you can prevent it by wrapping `onMouseDown={e => e.preventDefault()}` (see more at [#13448](https://github.com/ant-design/ant-design/issues/13448)).
```jsx
import React, { useState } from 'react';
diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md
index 90c686ed4919..5638cf67d0d7 100644
--- a/components/select/index.en-US.md
+++ b/components/select/index.en-US.md
@@ -37,7 +37,7 @@ Select component to select value from options.
| dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width. Default set `min-width` same as input. Will ignore when value less than select width. `false` will disable virtual scroll | boolean \| number | true | |
| dropdownRender | Customize dropdown content | (originNode: ReactNode) => ReactNode | - | |
| dropdownStyle | The style of dropdown menu | CSSProperties | - | |
-| fieldNames | Customize node title, key, options field name | object | { label: `label`, key: `key`, options: `options` } | 4.17.0 |
+| fieldNames | Customize node label, value, options field name | object | { label: `label`, value: `value`, options: `options` } | 4.17.0 |
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded | boolean \| function(inputValue, option) | true | |
| filterSort | Sort function for search options sorting, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction | (optionA: Option, optionB: Option) => number | - | 4.9.0 |
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative. [Example](https://codesandbox.io/s/4j168r7jw0) | function(triggerNode) | () => document.body | |
@@ -113,7 +113,7 @@ It's caused by option with different `label` and `value`. You can use `optionFil
### The dropdown is closed when click `dropdownRender` area?
-See the instruction in [dropdownRender example](#components-select-demo-custom-dropdown-menu).
+Dropdown menu will be closed if click `dropdownRender` area, you can prevent it by wrapping `onMouseDown={e => e.preventDefault()}` (see more at [#13448](https://github.com/ant-design/ant-design/issues/13448)).
### Why sometime customize Option cause scroll break?
diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md
index 280c7c5fd6b4..91cb942bf1ac 100644
--- a/components/select/index.zh-CN.md
+++ b/components/select/index.zh-CN.md
@@ -38,7 +38,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽。默认将设置 `min-width`,当值小于选择框宽度时会被忽略。false 时会关闭虚拟滚动 | boolean \| number | true | |
| dropdownRender | 自定义下拉框内容 | (originNode: ReactNode) => ReactNode | - | |
| dropdownStyle | 下拉菜单的 style 属性 | CSSProperties | - | |
-| fieldNames | 自定义节点 label、key、options 的字段 | object | { label: `label`, key: `key`, options: `options` } | 4.17.0 |
+| fieldNames | 自定义节点 label、value、options 的字段 | object | { label: `label`, value: `value`, options: `options` } | 4.17.0 |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 true,反之则返回 false | boolean \| function(inputValue, option) | true | |
| filterSort | 搜索时对筛选结果项的排序函数, 类似[Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)里的 compareFunction | (optionA: Option, optionB: Option) => number | - | 4.9.0 |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | function(triggerNode) | () => document.body | |
@@ -114,7 +114,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
### 点击 `dropdownRender` 里的内容浮层关闭怎么办?
-看下 [dropdownRender 例子](#components-select-demo-custom-dropdown-menu) 里的说明。
+自定义内容点击时会关闭浮层,如果不喜欢关闭,可以添加 `onMouseDown={e => e.preventDefault()}` 进行阻止(更多详情见 [#13448](https://github.com/ant-design/ant-design/issues/13448))。
### 自定义 Option 样式导致滚动异常怎么办?
diff --git a/components/select/style/status.less b/components/select/style/status.less
index cf528508d6c1..728b3e7acb2e 100644
--- a/components/select/style/status.less
+++ b/components/select/style/status.less
@@ -25,56 +25,52 @@
}
}
-.select-status-base(@prefix-cls) {
- .@{prefix-cls} {
- &-status-error {
- .select-status-color(@error-color, @error-color, @select-background, @error-color-hover, @error-color-outline);
- }
+.@{select-prefix-cls} {
+ &-status-error {
+ .select-status-color(@error-color, @error-color, @select-background, @error-color-hover, @error-color-outline);
+ }
- &-status-warning {
- .select-status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline);
- }
+ &-status-warning {
+ .select-status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline);
+ }
- &-status-success {
- .@{prefix-cls}-feedback-icon {
- color: @success-color;
- }
+ &-status-success {
+ .@{select-prefix-cls}-feedback-icon {
+ color: @success-color;
}
+ }
- &-status-validating {
- .@{prefix-cls}-feedback-icon {
- color: @primary-color;
- }
+ &-status-validating {
+ .@{select-prefix-cls}-feedback-icon {
+ color: @primary-color;
}
+ }
- &-status-error,
- &-status-warning,
- &-status-success,
- &-status-validating {
- &.@{prefix-cls}-has-feedback {
- //.@{prefix-cls}-arrow,
- .@{prefix-cls}-clear {
- right: 32px;
- }
+ &-status-error,
+ &-status-warning,
+ &-status-success,
+ &-status-validating {
+ &.@{select-prefix-cls}-has-feedback {
+ //.@{prefix-cls}-arrow,
+ .@{select-prefix-cls}-clear {
+ right: 32px;
+ }
- .@{prefix-cls}-selection-selected-value {
- padding-right: 42px;
- }
+ .@{select-prefix-cls}-selection-selected-value {
+ padding-right: 42px;
}
}
+ }
- &-feedback-icon {
- font-size: @font-size-base;
- text-align: center;
- visibility: visible;
- animation: zoomIn 0.3s @ease-out-back;
- pointer-events: none;
+ &-feedback-icon {
+ font-size: @font-size-base;
+ text-align: center;
+ visibility: visible;
+ animation: zoomIn 0.3s @ease-out-back;
+ pointer-events: none;
- &:not(:first-child) {
- margin-left: 8px;
- }
+ &:not(:first-child) {
+ margin-left: 8px;
}
}
}
-
-.select-status-base(@select-prefix-cls);
diff --git a/components/spin/index.en-US.md b/components/spin/index.en-US.md
index 30b1bc069bd2..5e54162d9c6f 100644
--- a/components/spin/index.en-US.md
+++ b/components/spin/index.en-US.md
@@ -18,7 +18,7 @@ When part of the page is waiting for asynchronous data or during a rendering pro
| delay | Specifies a delay in milliseconds for loading state (prevent flush) | number (milliseconds) | - |
| indicator | React node of the spinning indicator | ReactNode | - |
| size | The size of Spin, options: `small`, `default` and `large` | string | `default` |
-| spinning | Whether Spin is spinning | boolean | true |
+| spinning | Whether Spin is visible | boolean | true |
| tip | Customize description content when Spin has children | ReactNode | - |
| wrapperClassName | The className of wrapper when Spin has children | string | - |
diff --git a/components/style/themes/default.less b/components/style/themes/default.less
index d8f448de82e5..313e4ce4cea5 100644
--- a/components/style/themes/default.less
+++ b/components/style/themes/default.less
@@ -534,7 +534,7 @@
// Tooltip background color
@tooltip-bg: rgba(0, 0, 0, 0.75);
// Tooltip arrow width
-@tooltip-arrow-width: 5px;
+@tooltip-arrow-width: 8px * sqrt(2);
// Tooltip distance with trigger
@tooltip-distance: @tooltip-arrow-width - 1px + 4px;
// Tooltip arrow color
@@ -550,7 +550,7 @@
@popover-min-width: 177px;
@popover-min-height: 32px;
// Popover arrow width
-@popover-arrow-width: 6px;
+@popover-arrow-width: @tooltip-arrow-width;
// Popover arrow color
@popover-arrow-color: @popover-bg;
// Popover outer arrow width
diff --git a/components/style/themes/variable.less b/components/style/themes/variable.less
index 36846c426a5f..f0bd2c9434e1 100644
--- a/components/style/themes/variable.less
+++ b/components/style/themes/variable.less
@@ -590,7 +590,7 @@ html {
// Tooltip background color
@tooltip-bg: rgba(0, 0, 0, 0.75);
// Tooltip arrow width
-@tooltip-arrow-width: 5px;
+@tooltip-arrow-width: 8px * sqrt(2);
// Tooltip distance with trigger
@tooltip-distance: @tooltip-arrow-width - 1px + 4px;
// Tooltip arrow color
@@ -606,7 +606,7 @@ html {
@popover-min-width: 177px;
@popover-min-height: 32px;
// Popover arrow width
-@popover-arrow-width: 6px;
+@popover-arrow-width: @tooltip-arrow-width;
// Popover arrow color
@popover-arrow-color: @popover-bg;
// Popover outer arrow width
diff --git a/components/table/__tests__/Table.filter.test.js b/components/table/__tests__/Table.filter.test.js
index 94bdf194967f..018ca1228a9b 100644
--- a/components/table/__tests__/Table.filter.test.js
+++ b/components/table/__tests__/Table.filter.test.js
@@ -2198,312 +2198,4 @@ describe('Table.filter', () => {
expect(wrapper.find('Dropdown').first().props().visible).toBe(res2);
});
});
-
- describe('filter tree mode', () => {
- it('supports filter tree', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filterMode: 'tree',
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find(Tree).length).toBe(1);
- expect(wrapper.find('.ant-tree-checkbox').length).toBe(5);
- });
-
- it('supports search input in filter tree', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filterMode: 'tree',
- filterSearch: true,
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find(Tree).length).toBe(1);
- expect(wrapper.find(Input).length).toBe(1);
- wrapper
- .find(Input)
- .find('input')
- .simulate('change', { target: { value: '111' } });
- });
-
- it('supports search input in filter menu', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filterSearch: true,
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find(Menu).length).toBe(1);
- expect(wrapper.find(Input).length).toBe(1);
- wrapper
- .find(Input)
- .find('input')
- .simulate('change', { target: { value: '111' } });
- });
-
- it('should skip search when filters[0].text is ReactNode', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filters: [
- {
- text: '123',
- value: '456',
- },
- {
- text: 123456,
- value: '456',
- },
- {
- text: 123,
- value: '456',
- },
- ],
- filterSearch: true,
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find(Menu).length).toBe(1);
- expect(wrapper.find(Input).length).toBe(1);
- expect(wrapper.find('li.ant-dropdown-menu-item').length).toBe(3);
- wrapper
- .find(Input)
- .find('input')
- .simulate('change', { target: { value: '123' } });
- expect(wrapper.find('li.ant-dropdown-menu-item').length).toBe(2);
- });
-
- it('supports check all items', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filterMode: 'tree',
- filterSearch: true,
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find(Checkbox).length).toBe(1);
- expect(wrapper.find(Checkbox).text()).toBe('Select all items');
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(0);
- wrapper
- .find(Checkbox)
- .find('input')
- .simulate('change', { target: { checked: true } });
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(5);
- wrapper
- .find(Checkbox)
- .find('input')
- .simulate('change', { target: { checked: false } });
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(0);
- });
-
- it('supports check item by selecting it', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filterMode: 'tree',
- filterSearch: true,
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find(Checkbox).length).toBe(1);
- expect(wrapper.find(Checkbox).text()).toBe('Select all items');
- wrapper.find('.ant-tree-node-content-wrapper').at(0).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(0).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- });
- });
-
- it('filterMultiple is false - check item', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filterMode: 'tree',
- filterMultiple: false,
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find('.ant-tree-checkbox').length).toBe(5);
- expect(wrapper.find('.ant-table-filter-dropdown-checkall').exists()).toBe(false);
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(0);
- wrapper.find('.ant-tree-checkbox').at(2).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(2).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(1);
- wrapper.find('.ant-tree-checkbox').at(1).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(1).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(1);
- wrapper.find('.ant-tree-checkbox').at(1).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(1).hasClass('ant-tree-checkbox-checked')).toBe(
- false,
- );
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(0);
- });
-
- it('filterMultiple is false - select item', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filterMode: 'tree',
- filterMultiple: false,
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- expect(wrapper.find('.ant-tree-checkbox').length).toBe(5);
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(0);
- wrapper.find('.ant-tree-node-content-wrapper').at(2).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(2).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(1);
- wrapper.find('.ant-tree-node-content-wrapper').at(1).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(1).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(1);
- wrapper.find('.ant-tree-node-content-wrapper').at(1).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(1).hasClass('ant-tree-checkbox-checked')).toBe(
- false,
- );
- expect(wrapper.find('.ant-tree-checkbox-checked').length).toBe(0);
- });
-
- it('should select children when select parent', () => {
- jest.useFakeTimers();
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
- const wrapper = mount(
- createTable({
- columns: [
- {
- ...column,
- filters: [
- { text: 'Boy', value: 'boy' },
- { text: 'Girl', value: 'girl' },
- {
- text: 'Title',
- value: 'title',
- children: [
- { text: 'Jack', value: 'Jack' },
- { text: 'Coder', value: 'coder' },
- ],
- },
- ],
- filterMode: 'tree',
- },
- ],
- }),
- );
- wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
- act(() => {
- jest.runAllTimers();
- wrapper.update();
- });
- // check parentnode
- wrapper.find('.ant-tree-checkbox').at(2).simulate('click');
- expect(wrapper.find('.ant-tree-checkbox').at(2).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- expect(wrapper.find('.ant-tree-checkbox').at(3).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- expect(wrapper.find('.ant-tree-checkbox').at(4).hasClass('ant-tree-checkbox-checked')).toBe(
- true,
- );
- wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
- expect(renderedNames(wrapper)).toEqual(['Jack']);
- wrapper.find('.ant-tree-checkbox').at(2).simulate('click');
- wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
- expect(renderedNames(wrapper)).toEqual(['Jack', 'Lucy', 'Tom', 'Jerry']);
- wrapper.find('.ant-tree-node-content-wrapper').at(2).simulate('click');
- wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
- expect(renderedNames(wrapper)).toEqual(['Jack']);
- });
});
diff --git a/components/table/demo/filter-in-tree.md b/components/table/demo/filter-in-tree.md
index 768659a4c2e3..6c729839ba3c 100644
--- a/components/table/demo/filter-in-tree.md
+++ b/components/table/demo/filter-in-tree.md
@@ -10,8 +10,6 @@ title:
可以使用 `filterMode` 来修改筛选菜单的 UI,可选值有 `menu`(默认)和 `tree`。
-> `filterSearch` 用于开启筛选项的搜索。
-
## en-US
You can use `filterMode` to change default filter interface, options: `menu`(default) and `tree`.
diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md
index 6d8902a8808f..a816953203a7 100644
--- a/components/table/index.en-US.md
+++ b/components/table/index.en-US.md
@@ -62,7 +62,7 @@ const columns = [
| --- | --- | --- | --- | --- |
| bordered | Whether to show all table borders | boolean | false | |
| columns | Columns of table | [ColumnsType](#Column)\[] | - | |
-| components | Override default table elements | [TableComponents](https://git.io/fANxz) | - | |
+| components | Override default table elements | [TableComponents](https://github.com/react-component/table/blob/75ee0064e54a4b3215694505870c9d6c817e9e4a/src/interface.ts#L129) | - | |
| dataSource | Data record array to be displayed | object\[] | - | |
| expandable | Config expandable content | [expandable](#expandable) | - | |
| footer | Table footer renderer | function(currentPageData) | - | |
diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md
index cab38525e624..4abd6b8c5b0d 100644
--- a/components/table/index.zh-CN.md
+++ b/components/table/index.zh-CN.md
@@ -69,7 +69,7 @@ const columns = [
| --- | --- | --- | --- | --- |
| bordered | 是否展示外边框和列边框 | boolean | false | |
| columns | 表格列的配置描述,具体项见下表 | [ColumnsType](#Column)\[] | - | |
-| components | 覆盖默认的 table 元素 | [TableComponents](https://git.io/fANxz) | - | |
+| components | 覆盖默认的 table 元素 | [TableComponents](https://github.com/react-component/table/blob/75ee0064e54a4b3215694505870c9d6c817e9e4a/src/interface.ts#L129) | - | |
| dataSource | 数据数组 | object\[] | - | |
| expandable | 配置展开属性 | [expandable](#expandable) | - | |
| footer | 表格尾部 | function(currentPageData) | - | |
diff --git a/components/time-picker/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/time-picker/__tests__/__snapshots__/demo-extend.test.ts.snap
index 653e9f58666b..bc4d354a4c05 100644
--- a/components/time-picker/__tests__/__snapshots__/demo-extend.test.ts.snap
+++ b/components/time-picker/__tests__/__snapshots__/demo-extend.test.ts.snap
@@ -20435,6 +20435,7 @@ exports[`renders ./components/time-picker/demo/status.md extend context correctl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+ 00
+
+
+ -
+
+ 01
+
+
+ -
+
+ 02
+
+
+ -
+
+ 03
+
+
+ -
+
+ 04
+
+
+ -
+
+ 05
+
+
+ -
+
+ 06
+
+
+ -
+
+ 07
+
+
+ -
+
+ 08
+
+
+ -
+
+ 09
+
+
+ -
+
+ 10
+
+
+ -
+
+ 11
+
+
+ -
+
+ 12
+
+
+ -
+
+ 13
+
+
+ -
+
+ 14
+
+
+ -
+
+ 15
+
+
+ -
+
+ 16
+
+
+ -
+
+ 17
+
+
+ -
+
+ 18
+
+
+ -
+
+ 19
+
+
+ -
+
+ 20
+
+
+ -
+
+ 21
+
+
+ -
+
+ 22
+
+
+ -
+
+ 23
+
+
+
+
+ -
+
+ 00
+
+
+ -
+
+ 01
+
+
+ -
+
+ 02
+
+
+ -
+
+ 03
+
+
+ -
+
+ 04
+
+
+ -
+
+ 05
+
+
+ -
+
+ 06
+
+
+ -
+
+ 07
+
+
+ -
+
+ 08
+
+
+ -
+
+ 09
+
+
+ -
+
+ 10
+
+
+ -
+
+ 11
+
+
+ -
+
+ 12
+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+
+ -
+
+ 08
+
+
+ -
+
+ 09
+
+
+ -
+
+ 10
+
+
+ -
+
+ 11
+
+
+ -
+
+ 12
+
+
+ -
+
+ 13
+
+
+ -
+
+ 14
+
+
+ -
+
+ 15
+
+
+ -
+
+ 16
+
+
+ -
+
+ 17
+
+
+ -
+
+ 18
+
+
+ -
+
+ 19
+
+
+ -
+
+ 20
+
+
+ -
+
+ 21
+
+
+ -
+
+ 22
+
+
+ -
+
+ 23
+
+
+ -
+
+ 24
+
+
+ -
+
+ 25
+
+
+ -
+
+ 26
+
+
+ -
+
+ 27
+
+
+ -
+
+ 28
+
+
+ -
+
+ 29
+
+
+ -
+
+ 30
+
+
+ -
+
+ 31
+
+
+ -
+
+ 32
+
+
+ -
+
+ 33
+
+
+ -
+
+ 34
+
+
+ -
+
+ 35
+
+
+ -
+
+ 36
+
+
+ -
+
+ 37
+
+
+ -
+
+ 38
+
+
+ -
+
+ 39
+
+
+ -
+
+ 40
+
+
+ -
+
+ 41
+
+
+ -
+
+ 42
+
+
+ -
+
+ 43
+
+
+ -
+
+ 44
+
+
+ -
+
+ 45
+
+
+ -
+
+ 46
+
+
+ -
+
+ 47
+
+
+ -
+
+ 48
+
+
+ -
+
+ 49
+
+
+ -
+
+ 50
+
+
+ -
+
+ 51
+
+
+ -
+
+ 52
+
+
+ -
+
+ 53
+
+
+ -
+
+ 54
+
+
+ -
+
+ 55
+
+
+ -
+
+ 56
+
+
+ -
+
+ 57
+
+
+ -
+
+ 58
+
+
+ -
+
+ 59
+
+
+
+
+
+
+
+
+
+
+
+
+
`;
diff --git a/components/time-picker/__tests__/__snapshots__/demo.test.js.snap b/components/time-picker/__tests__/__snapshots__/demo.test.js.snap
index 22eb62f1ce01..500aad5cda88 100644
--- a/components/time-picker/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/time-picker/__tests__/__snapshots__/demo.test.js.snap
@@ -901,6 +901,7 @@ exports[`renders ./components/time-picker/demo/status.md correctly 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`;
diff --git a/components/time-picker/demo/status.md b/components/time-picker/demo/status.md
index 24757ced26de..f7ce835c9251 100644
--- a/components/time-picker/demo/status.md
+++ b/components/time-picker/demo/status.md
@@ -21,6 +21,8 @@ const Status: React.FC = () => (
+
+
);
diff --git a/components/timeline/index.zh-CN.md b/components/timeline/index.zh-CN.md
index 40ca1eb5928a..05acb976a7ad 100644
--- a/components/timeline/index.zh-CN.md
+++ b/components/timeline/index.zh-CN.md
@@ -41,7 +41,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/vJmo00mmgR/Timeline.svg
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
-| color | 指定圆圈颜色 `blue`, `red`, `green`, `gray`,或自定义的色值 | string | `blue` |
+| color | 指定圆圈颜色 `blue`、`red`、`green`、`gray`,或自定义的色值 | string | `blue` |
| dot | 自定义时间轴点 | ReactNode | - |
| label | 设置标签 | ReactNode | - |
| position | 自定义节点位置 | `left` \| `right` | - |
diff --git a/components/tooltip/style/index.less b/components/tooltip/style/index.less
index 69844c8a8ead..fa7613950ad4 100644
--- a/components/tooltip/style/index.less
+++ b/components/tooltip/style/index.less
@@ -19,6 +19,7 @@
z-index: @zindex-tooltip;
display: block;
width: max-content;
+ width: intrinsic;
max-width: @tooltip-max-width;
visibility: visible;
@@ -200,7 +201,7 @@
}
.@{tooltip-prefix-cls}-arrow {
&-content::before {
- background-color: @@lightColor;
+ background: @@lightColor;
}
}
}
diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx
index 27764b2fbc6b..c4418b693e7b 100644
--- a/components/transfer/index.tsx
+++ b/components/transfer/index.tsx
@@ -79,7 +79,12 @@ export interface TransferProps {
showSearch?: boolean;
filterOption?: (inputValue: string, item: RecordType) => boolean;
locale?: Partial;
- footer?: (props: TransferListProps) => React.ReactNode;
+ footer?: (
+ props: TransferListProps,
+ info?: {
+ direction: TransferDirection;
+ },
+ ) => React.ReactNode;
rowKey?: (record: RecordType) => string;
onSearch?: (direction: TransferDirection, value: string) => void;
onScroll?: (direction: TransferDirection, e: React.SyntheticEvent) => void;
diff --git a/components/transfer/style/status.less b/components/transfer/style/status.less
index 5eab3bb94e65..a86122317485 100644
--- a/components/transfer/style/status.less
+++ b/components/transfer/style/status.less
@@ -2,7 +2,7 @@
@transfer-prefix-cls: ~'@{ant-prefix}-transfer';
-.status-color(@color) {
+.transfer-status-color(@color) {
.@{transfer-prefix-cls}-list {
border-color: @color;
@@ -22,10 +22,10 @@
.@{transfer-prefix-cls} {
&-status-error {
- .status-color(@error-color);
+ .transfer-status-color(@error-color);
}
&-status-warning {
- .status-color(@warning-color);
+ .transfer-status-color(@warning-color);
}
}
diff --git a/components/tree-select/index.en-US.md b/components/tree-select/index.en-US.md
index 4a8a49c1c020..feae8947e8ac 100644
--- a/components/tree-select/index.en-US.md
+++ b/components/tree-select/index.en-US.md
@@ -55,6 +55,7 @@ Tree selection control.
| treeDefaultExpandedKeys | Default expanded treeNodes | string\[] | - | |
| 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[] | [] | |
| treeLine | Show the line. Ref [Tree - showLine](/components/tree/#components-tree-demo-line) | boolean \| object | false | 4.17.0 |
| treeNodeFilterProp | Will be used for filtering if `filterTreeNode` returns true | string | `value` | |
| treeNodeLabelProp | Will render as content of select | string | `title` | |
diff --git a/components/tree-select/index.zh-CN.md b/components/tree-select/index.zh-CN.md
index 83e61794032c..a5e3cbdca7f9 100644
--- a/components/tree-select/index.zh-CN.md
+++ b/components/tree-select/index.zh-CN.md
@@ -57,6 +57,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Ax4DA0njr/TreeSelect.svg
| treeExpandedKeys | 设置展开的树节点 | string\[] | - | |
| treeIcon | 是否展示 TreeNode title 前的图标,没有默认样式,如设置为 true,需要自行定义图标相关样式 | boolean | false | |
| treeLine | 是否展示线条样式,请参考 [Tree - showLine](/components/tree/#components-tree-demo-line) | boolean \| object | false | 4.17.0 |
+| treeLoadedKeys | (受控)已经加载的节点,需要配合 `loadData` 使用 | string[] | [] | |
| treeNodeFilterProp | 输入项过滤对应的 treeNode 属性 | string | `value` | |
| treeNodeLabelProp | 作为显示的 prop 设置 | string | `title` | |
| value | 指定当前选中的条目 | string \| string\[] | - | |
diff --git a/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap
index 14c63f05948a..3476cd1b2472 100644
--- a/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap
+++ b/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap
@@ -3634,7 +3634,6 @@ exports[`renders ./components/tree/demo/search.md extend context correctly 1`] =
aria-label="search"
class="anticon anticon-search"
role="img"
- style="color:#999999"
>