fix : type error at align property in dropdown (#44423)

This commit is contained in:
LeTuongKhanh 2023-08-26 22:51:07 +07:00 committed by GitHub
parent e8b5a187e7
commit cc2c26b263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import RcDropdown from 'rc-dropdown';
import useEvent from 'rc-util/lib/hooks/useEvent';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import omit from 'rc-util/lib/omit';
import type { AlignType } from '@rc-component/trigger';
import * as React from 'react';
import genPurePanel from '../_util/PurePanel';
import type { AdjustOverflow } from '../_util/placements';
@ -28,24 +29,11 @@ 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;
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 = {
pointAtCenter?: boolean;
};
@ -60,7 +48,7 @@ export interface DropdownProps {
open?: boolean;
disabled?: boolean;
destroyPopupOnHide?: boolean;
align?: Align;
align?: AlignType;
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
prefixCls?: string;
className?: string;