New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add/fix tooltip align interface #12354

Merged
merged 2 commits into from Sep 23, 2018
Jump to file or symbol
Failed to load files and symbols.
+16 −0
Diff settings

Always

Just for now

@@ -35,6 +35,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
| trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` \| `contextMenu` | `hover` |
| visible | Whether the floating tooltip card is visible or not | boolean | `false` |
| onVisibleChange | Callback executed when visibility of the tooltip card is changed | (visible) => void | - |
| align | this value will be merged into placement's config, please refer to the settings [rc-tooltip](https://github.com/react-component/tooltip) | Object | - |
## Note
Copy path View file
@@ -15,6 +15,18 @@ export type TooltipPlacement =
export type TooltipTrigger = 'hover' | 'focus' | 'click' | 'contextMenu';
// https://github.com/react-component/tooltip
// https://github.com/yiminghe/dom-align
export interface TooltipAlignConfig {
points?: [string, string],
offset?: [number | string, number | string],
targetOffset?: [number | string, number | string],
overflow?: { adjustX: boolean, adjustY: boolean },
useCssRight?: boolean,
useCssBottom?: boolean,
useCssTransform?: boolean
}
export interface AbstractTooltipProps {
prefixCls?: string;
overlayClassName?: string;
@@ -36,6 +48,8 @@ export interface AbstractTooltipProps {
getTooltipContainer?: (triggerNode: Element) => HTMLElement;
getPopupContainer?: (triggerNode: Element) => HTMLElement;
children?: React.ReactNode;
// align is a more higher api
align?: TooltipAlignConfig;
}
export type RenderFunction = () => React.ReactNode;
@@ -37,6 +37,7 @@ title: Tooltip
| trigger | 触发行为,可选 `hover/focus/click/contextMenu` | string | hover |
| visible | 用于手动控制浮层显隐 | boolean | false |
| onVisibleChange | 显示隐藏的回调 | (visible) => void | 无 |
| align | 该值将合并到 placement 的配置中,设置参考 [rc-tooltip](https://github.com/react-component/tooltip) | Object | 无 |
## 注意
ProTip! Use n and p to navigate between commits in a pull request.