mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
refactor: avoid circular import (#42764)
This commit is contained in:
parent
f6dc5f39e0
commit
e1e5c740e0
@ -16,7 +16,6 @@ import Menu from '../menu';
|
||||
import { OverrideProvider } from '../menu/OverrideContext';
|
||||
import { NoCompactStyle } from '../space/Compact';
|
||||
import theme from '../theme';
|
||||
import DropdownButton from './dropdown-button';
|
||||
import useStyle from './style';
|
||||
|
||||
const Placements = [
|
||||
@ -30,7 +29,7 @@ const Placements = [
|
||||
'bottom',
|
||||
] as const;
|
||||
|
||||
type Placement = typeof Placements[number];
|
||||
type Placement = (typeof Placements)[number];
|
||||
type DropdownPlacement = Exclude<Placement, 'topCenter' | 'bottomCenter'>;
|
||||
|
||||
type OverlayFunc = () => React.ReactElement;
|
||||
@ -88,7 +87,6 @@ export interface DropdownProps {
|
||||
}
|
||||
|
||||
type CompoundedComponent = React.FC<DropdownProps> & {
|
||||
Button: typeof DropdownButton;
|
||||
_InternalPanelDoNotUseOrYouWillBeFired: typeof WrapPurePanel;
|
||||
};
|
||||
|
||||
@ -305,8 +303,6 @@ const Dropdown: CompoundedComponent = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
Dropdown.Button = DropdownButton;
|
||||
|
||||
function postPureProps(props: DropdownProps) {
|
||||
return {
|
||||
...props,
|
||||
|
@ -1,10 +1,17 @@
|
||||
import Dropdown from './dropdown';
|
||||
import InternalDropdown from './dropdown';
|
||||
import DropdownButton from './dropdown-button';
|
||||
|
||||
export type {
|
||||
DropdownProps,
|
||||
// typo, but we need to support it for backwards compatibility
|
||||
// https://github.com/ant-design/ant-design/pull/35161
|
||||
DropdownProps as DropDownProps,
|
||||
DropdownProps,
|
||||
} from './dropdown';
|
||||
export type { DropdownButtonProps, DropdownButtonType } from './dropdown-button';
|
||||
|
||||
const Dropdown = InternalDropdown as typeof InternalDropdown & {
|
||||
Button: typeof DropdownButton;
|
||||
};
|
||||
Dropdown.Button = DropdownButton;
|
||||
|
||||
export default Dropdown;
|
||||
|
Loading…
Reference in New Issue
Block a user