mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
parent
613077ac8e
commit
711c9d6754
@ -288,7 +288,8 @@ const Dropdown: CompoundedComponent = (props) => {
|
||||
mouseEnterDelay={mouseEnterDelay}
|
||||
mouseLeaveDelay={mouseLeaveDelay}
|
||||
visible={mergedOpen}
|
||||
builtinPlacements={builtinPlacements}
|
||||
// TODO: remove `as any` when `rc-dropdown` upgrade to use `@rc-component/trigger`
|
||||
builtinPlacements={builtinPlacements as any}
|
||||
arrow={!!arrow}
|
||||
overlayClassName={overlayClassNameCustomized}
|
||||
prefixCls={prefixCls}
|
||||
|
@ -1,17 +1,14 @@
|
||||
import type { BuildInPlacements, AlignType } from '@rc-component/trigger';
|
||||
import type { AlignType, BuildInPlacements } from '@rc-component/trigger';
|
||||
import classNames from 'classnames';
|
||||
import RcTooltip from 'rc-tooltip';
|
||||
import type { placements as Placements } from 'rc-tooltip/lib/placements';
|
||||
import type {
|
||||
TooltipProps as RcTooltipProps,
|
||||
TooltipRef as RcTooltipRef,
|
||||
} from 'rc-tooltip/lib/Tooltip';
|
||||
import type { placements as Placements } from 'rc-tooltip/lib/placements';
|
||||
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
||||
import type { CSSProperties } from 'react';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { NoCompactStyle } from '../space/Compact';
|
||||
import theme from '../theme';
|
||||
import type { PresetColorType } from '../_util/colors';
|
||||
import { getTransitionName } from '../_util/motion';
|
||||
import type { AdjustOverflow, PlacementsConfig } from '../_util/placements';
|
||||
@ -19,6 +16,9 @@ import getPlacements from '../_util/placements';
|
||||
import { cloneElement, isFragment, isValidElement } from '../_util/reactNode';
|
||||
import type { LiteralUnion } from '../_util/type';
|
||||
import warning from '../_util/warning';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { NoCompactStyle } from '../space/Compact';
|
||||
import theme from '../theme';
|
||||
import PurePanel from './PurePanel';
|
||||
import useStyle from './style';
|
||||
import { parseColor } from './util';
|
||||
@ -311,12 +311,12 @@ const Tooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref) => {
|
||||
const transformOrigin: React.CSSProperties = { top: '50%', left: '50%' };
|
||||
|
||||
if (/top|Bottom/.test(placement)) {
|
||||
transformOrigin.top = `${rect.height - align.offset![1]}px`;
|
||||
transformOrigin.top = `${rect.height - (align.offset![1] as number)}px`;
|
||||
} else if (/Top|bottom/.test(placement)) {
|
||||
transformOrigin.top = `${-align.offset![1]}px`;
|
||||
}
|
||||
if (/left|Right/.test(placement)) {
|
||||
transformOrigin.left = `${rect.width - align.offset![0]}px`;
|
||||
transformOrigin.left = `${rect.width - (align.offset![0] as number)}px`;
|
||||
} else if (/right|Left/.test(placement)) {
|
||||
transformOrigin.left = `${-align.offset![0]}px`;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@
|
||||
"@ctrl/tinycolor": "^3.6.0",
|
||||
"@rc-component/mutate-observer": "^1.0.0",
|
||||
"@rc-component/tour": "~1.8.0",
|
||||
"@rc-component/trigger": "^1.7.0",
|
||||
"@rc-component/trigger": "^1.11.0",
|
||||
"classnames": "^2.2.6",
|
||||
"copy-to-clipboard": "^3.2.0",
|
||||
"dayjs": "^1.11.1",
|
||||
|
Loading…
Reference in New Issue
Block a user