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 { OverrideProvider } from '../menu/OverrideContext';
|
||||||
import { NoCompactStyle } from '../space/Compact';
|
import { NoCompactStyle } from '../space/Compact';
|
||||||
import theme from '../theme';
|
import theme from '../theme';
|
||||||
import DropdownButton from './dropdown-button';
|
|
||||||
import useStyle from './style';
|
import useStyle from './style';
|
||||||
|
|
||||||
const Placements = [
|
const Placements = [
|
||||||
@ -30,7 +29,7 @@ const Placements = [
|
|||||||
'bottom',
|
'bottom',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
type Placement = typeof Placements[number];
|
type Placement = (typeof Placements)[number];
|
||||||
type DropdownPlacement = Exclude<Placement, 'topCenter' | 'bottomCenter'>;
|
type DropdownPlacement = Exclude<Placement, 'topCenter' | 'bottomCenter'>;
|
||||||
|
|
||||||
type OverlayFunc = () => React.ReactElement;
|
type OverlayFunc = () => React.ReactElement;
|
||||||
@ -88,7 +87,6 @@ export interface DropdownProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CompoundedComponent = React.FC<DropdownProps> & {
|
type CompoundedComponent = React.FC<DropdownProps> & {
|
||||||
Button: typeof DropdownButton;
|
|
||||||
_InternalPanelDoNotUseOrYouWillBeFired: typeof WrapPurePanel;
|
_InternalPanelDoNotUseOrYouWillBeFired: typeof WrapPurePanel;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -305,8 +303,6 @@ const Dropdown: CompoundedComponent = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Dropdown.Button = DropdownButton;
|
|
||||||
|
|
||||||
function postPureProps(props: DropdownProps) {
|
function postPureProps(props: DropdownProps) {
|
||||||
return {
|
return {
|
||||||
...props,
|
...props,
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
import Dropdown from './dropdown';
|
import InternalDropdown from './dropdown';
|
||||||
|
import DropdownButton from './dropdown-button';
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
DropdownProps,
|
|
||||||
// typo, but we need to support it for backwards compatibility
|
// typo, but we need to support it for backwards compatibility
|
||||||
// https://github.com/ant-design/ant-design/pull/35161
|
// https://github.com/ant-design/ant-design/pull/35161
|
||||||
DropdownProps as DropDownProps,
|
DropdownProps as DropDownProps,
|
||||||
|
DropdownProps,
|
||||||
} from './dropdown';
|
} from './dropdown';
|
||||||
export type { DropdownButtonProps, DropdownButtonType } from './dropdown-button';
|
export type { DropdownButtonProps, DropdownButtonType } from './dropdown-button';
|
||||||
|
|
||||||
|
const Dropdown = InternalDropdown as typeof InternalDropdown & {
|
||||||
|
Button: typeof DropdownButton;
|
||||||
|
};
|
||||||
|
Dropdown.Button = DropdownButton;
|
||||||
|
|
||||||
export default Dropdown;
|
export default Dropdown;
|
||||||
|
Loading…
Reference in New Issue
Block a user