mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
fix : type error at align property in dropdown (#44423)
This commit is contained in:
parent
e8b5a187e7
commit
cc2c26b263
@ -4,6 +4,7 @@ import RcDropdown from 'rc-dropdown';
|
|||||||
import useEvent from 'rc-util/lib/hooks/useEvent';
|
import useEvent from 'rc-util/lib/hooks/useEvent';
|
||||||
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
||||||
import omit from 'rc-util/lib/omit';
|
import omit from 'rc-util/lib/omit';
|
||||||
|
import type { AlignType } from '@rc-component/trigger';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import genPurePanel from '../_util/PurePanel';
|
import genPurePanel from '../_util/PurePanel';
|
||||||
import type { AdjustOverflow } from '../_util/placements';
|
import type { AdjustOverflow } from '../_util/placements';
|
||||||
@ -28,24 +29,11 @@ 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;
|
||||||
|
|
||||||
type Align = {
|
|
||||||
points?: [string, string];
|
|
||||||
offset?: [number, number];
|
|
||||||
targetOffset?: [number, number];
|
|
||||||
overflow?: {
|
|
||||||
adjustX?: boolean;
|
|
||||||
adjustY?: boolean;
|
|
||||||
};
|
|
||||||
useCssRight?: boolean;
|
|
||||||
useCssBottom?: boolean;
|
|
||||||
useCssTransform?: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type DropdownArrowOptions = {
|
export type DropdownArrowOptions = {
|
||||||
pointAtCenter?: boolean;
|
pointAtCenter?: boolean;
|
||||||
};
|
};
|
||||||
@ -60,7 +48,7 @@ export interface DropdownProps {
|
|||||||
open?: boolean;
|
open?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
destroyPopupOnHide?: boolean;
|
destroyPopupOnHide?: boolean;
|
||||||
align?: Align;
|
align?: AlignType;
|
||||||
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user