refactor: upgrade rc-dropdown (#19498)

* refator: upgrade rc-dropdown

* upgrade rc-dropdown version

* update snapshots
This commit is contained in:
骗你是小猫咪 2019-11-06 14:49:20 +08:00 committed by 二货机器人
parent 019de87ebe
commit 0ee4a531a1
8 changed files with 22 additions and 19 deletions

View File

@ -105,7 +105,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
paths.push(path);
}
// generated overlay by route.children
let overlay = null;
let overlay;
if (route.children && route.children.length) {
overlay = (
<Menu>

View File

@ -80,7 +80,6 @@ exports[`react router react router 3 1`] = `
>
<BreadcrumbItem
key="Home"
overlay={null}
separator="/"
>
<span>
@ -102,7 +101,6 @@ exports[`react router react router 3 1`] = `
</BreadcrumbItem>
<BreadcrumbItem
key="Application List"
overlay={null}
separator="/"
>
<span>
@ -124,7 +122,6 @@ exports[`react router react router 3 1`] = `
</BreadcrumbItem>
<BreadcrumbItem
key="Application:id"
overlay={null}
separator="/"
>
<span>
@ -146,7 +143,6 @@ exports[`react router react router 3 1`] = `
</BreadcrumbItem>
<BreadcrumbItem
key="Detail"
overlay={null}
separator="/"
>
<span>

View File

@ -11772,7 +11772,7 @@ exports[`ConfigProvider components Table configProvider 1`] = `
</span>
<span
aria-label="filter"
class="anticon anticon-filter config-table-filter-open config-dropdown-trigger config-dropdown-open"
class="anticon anticon-filter config-table-filter-open config-dropdown-trigger"
role="img"
tabindex="-1"
title="Filter menu"
@ -11795,6 +11795,7 @@ exports[`ConfigProvider components Table configProvider 1`] = `
<div>
<div
class="config-dropdown config-dropdown-placement-bottomRight "
style="visibility:hidden"
>
<div
class="config-table-filter-dropdown"
@ -12021,7 +12022,7 @@ exports[`ConfigProvider components Table normal 1`] = `
</span>
<span
aria-label="filter"
class="anticon anticon-filter ant-table-filter-open ant-dropdown-trigger ant-dropdown-open"
class="anticon anticon-filter ant-table-filter-open ant-dropdown-trigger"
role="img"
tabindex="-1"
title="Filter menu"
@ -12044,6 +12045,7 @@ exports[`ConfigProvider components Table normal 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight "
style="visibility:hidden"
>
<div
class="ant-table-filter-dropdown"
@ -12270,7 +12272,7 @@ exports[`ConfigProvider components Table prefixCls 1`] = `
</span>
<span
aria-label="filter"
class="anticon anticon-filter prefix-Table-filter-open ant-dropdown-trigger ant-dropdown-open"
class="anticon anticon-filter prefix-Table-filter-open ant-dropdown-trigger"
role="img"
tabindex="-1"
title="Filter menu"
@ -12293,6 +12295,7 @@ exports[`ConfigProvider components Table prefixCls 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight "
style="visibility:hidden"
>
<div
class="prefix-Table-filter-dropdown"

View File

@ -18,7 +18,7 @@ const Placements = tuple(
);
type Placement = (typeof Placements)[number];
type OverlayFunc = () => React.ReactNode;
type OverlayFunc = () => React.ReactElement;
type Align = {
points?: [string, string];
@ -35,7 +35,7 @@ type Align = {
export interface DropDownProps {
trigger?: ('click' | 'hover' | 'contextMenu')[];
overlay: React.ReactNode | OverlayFunc;
overlay: React.ReactElement | OverlayFunc;
onVisibleChange?: (visible: boolean) => void;
visible?: boolean;
disabled?: boolean;
@ -115,7 +115,7 @@ export default class Dropdown extends React.Component<DropDownProps, any> {
expandIcon,
});
return fixedModeOverlay;
return fixedModeOverlay as React.ReactElement;
};
renderDropDown = ({

View File

@ -30,6 +30,7 @@ exports[`Table.filter renders custom content correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight ant-dropdown-hidden"
style="visibility:hidden"
>
<div
class="ant-table-filter-dropdown"
@ -192,6 +193,7 @@ exports[`Table.filter renders menu correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight ant-dropdown-hidden"
style="visibility:hidden"
>
<div
class="ant-table-filter-dropdown"
@ -287,6 +289,7 @@ exports[`Table.filter renders radio filter correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight ant-dropdown-hidden"
style="visibility:hidden"
>
<div
class="ant-table-filter-dropdown"
@ -426,7 +429,7 @@ exports[`Table.filter should support getPopupContainer 1`] = `
</span>
<span
aria-label="filter"
class="anticon anticon-filter ant-table-filter-open ant-dropdown-trigger ant-dropdown-open"
class="anticon anticon-filter ant-table-filter-open ant-dropdown-trigger"
role="img"
style=""
tabindex="-1"
@ -449,8 +452,8 @@ exports[`Table.filter should support getPopupContainer 1`] = `
</span>
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight slide-up-appear"
style="left: -999px; top: -995px;"
class="ant-dropdown ant-dropdown-placement-bottomRight"
style="left: -999px; top: -995px; min-width: 0;"
>
<div
class="ant-table-filter-dropdown"
@ -646,7 +649,7 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] =
</span>
<span
aria-label="filter"
class="anticon anticon-filter ant-table-filter-open ant-dropdown-trigger ant-dropdown-open"
class="anticon anticon-filter ant-table-filter-open ant-dropdown-trigger"
role="img"
style=""
tabindex="-1"
@ -669,8 +672,8 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] =
</span>
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight slide-up-appear"
style="left: -999px; top: -995px;"
class="ant-dropdown ant-dropdown-placement-bottomRight"
style="left: -999px; top: -995px; min-width: 0;"
>
<div
class="ant-table-filter-dropdown"

View File

@ -993,6 +993,7 @@ exports[`Table.rowSelection render with default selection correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomLeft ant-dropdown-hidden"
style="visibility:hidden"
>
<ul
class="ant-dropdown-menu ant-table-selection-menu ant-dropdown-menu-light ant-dropdown-menu-root ant-dropdown-menu-vertical"

View File

@ -112,7 +112,7 @@
"rc-collapse": "~1.11.3",
"rc-dialog": "~7.5.2",
"rc-drawer": "~3.0.0",
"rc-dropdown": "~2.4.1",
"rc-dropdown": "~3.0.0-alpha.0",
"rc-editor-mention": "^1.1.13",
"rc-field-form": "^0.0.0-alpha.17",
"rc-form": "^2.4.5",

View File

@ -18,7 +18,7 @@ declare module 'rc-cascader';
declare module 'rc-checkbox';
declare module 'rc-dropdown';
declare module 'rc-radio';
declare module 'rc-editor-mention';