@progress/kendo-react-tooltip 13.3.0 → 13.4.0-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { default as PropTypes } from 'prop-types';
9
+ import { ZIndexContext } from '@progress/kendo-react-common';
10
+ import { TooltipProps } from './TooltipProps.js';
11
+ import * as React from 'react';
12
+ /**
13
+ * @hidden
14
+ */
15
+ interface TooltipState {
16
+ targetElement: HTMLElement | null;
17
+ open: boolean;
18
+ title: string;
19
+ }
20
+ /**
21
+ * Represents the [KendoReact Tooltip component](https://www.telerik.com/kendo-react-ui/components/tooltip/tooltip).
22
+ *
23
+ * Accepts properties of type [TooltipProps](https://www.telerik.com/kendo-react-ui/components/tooltip/api/tooltipprops).
24
+ */
25
+ export declare class Tooltip extends React.PureComponent<TooltipProps, TooltipState> {
26
+ /**
27
+ * @hidden
28
+ */
29
+ static propTypes: {
30
+ anchorElement: PropTypes.Requireable<string>;
31
+ content: PropTypes.Requireable<(...args: any[]) => any>;
32
+ filter: PropTypes.Requireable<(...args: any[]) => any>;
33
+ openDelay: PropTypes.Requireable<number>;
34
+ position: PropTypes.Requireable<string>;
35
+ updateInterval: PropTypes.Requireable<number>;
36
+ showOption: PropTypes.Requireable<object>;
37
+ };
38
+ /**
39
+ * The default properties of the Tooltip component.
40
+ */
41
+ static defaultProps: {
42
+ anchorElement: string;
43
+ openDelay: number;
44
+ position: string;
45
+ showCallout: boolean;
46
+ parentTitle: boolean;
47
+ };
48
+ /**
49
+ * @hidden
50
+ */
51
+ static contextType: React.Context<import('@progress/kendo-react-common').ZIndexContextType>;
52
+ /**
53
+ * @hidden
54
+ */
55
+ context: React.ContextType<typeof ZIndexContext>;
56
+ /**
57
+ * @hidden
58
+ */
59
+ readonly state: TooltipState;
60
+ private top;
61
+ private left;
62
+ private openTimeoutId?;
63
+ private updateIntervalId?;
64
+ private willOpen;
65
+ /**
66
+ * @hidden
67
+ */
68
+ componentDidMount(): void;
69
+ /**
70
+ * @hidden
71
+ */
72
+ componentWillUnmount(): void;
73
+ /**
74
+ * @hidden
75
+ */
76
+ componentDidUpdate(): void;
77
+ /**
78
+ * The method is used on the MouseOut event to hide the Tooltip.
79
+ *
80
+ * @param event The mouse event object.
81
+ */
82
+ handleMouseOut: (event: any) => void;
83
+ private compareTargets;
84
+ private handleEscape;
85
+ /**
86
+ * @hidden
87
+ */
88
+ handleTargetItemClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
89
+ private handleKeyDown;
90
+ /**
91
+ * Used on the `MouseOver` event to show the Tooltip.
92
+ *
93
+ * @param event The mouse event object.
94
+ */
95
+ handleMouseOver: (event: any) => void;
96
+ /**
97
+ * @hidden
98
+ */
99
+ render(): "" | React.JSX.Element | null;
100
+ private handleBodyMousemove;
101
+ private onClose;
102
+ private showToolTip;
103
+ private setUpdateInterval;
104
+ private onIntervalUpdate;
105
+ private isVisible;
106
+ private position;
107
+ private getTitle;
108
+ private calloutClassName;
109
+ private getCurrentZIndex;
110
+ }
111
+ export {};
@@ -0,0 +1,257 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { TooltipEvent, TooltipPositionEvent } from './events.js';
9
+ import { TooltipPosition, TooltipShowOptions } from './utils.js';
10
+ /**
11
+ * Represents the props of the [KendoReact Tooltip component](https://www.telerik.com/kendo-react-ui/components/tooltip/tooltip).
12
+ */
13
+ export interface TooltipProps {
14
+ /**
15
+ * Specifies the `id` of the wrapping element of the Tooltip component.
16
+ * Used to uniquely identify the Tooltip element in the DOM.
17
+ *
18
+ * @example
19
+ * ```jsx
20
+ * <Tooltip id="tooltip-id" />
21
+ * ```
22
+ */
23
+ id?: string;
24
+ /**
25
+ * Sets the anchor element of the Tooltip.
26
+ *
27
+ * The available options are:
28
+ * - (Default) `pointer`&mdash;Positions the Tooltip where the cursor is located.
29
+ * - `target`&mdash;Positions the Tooltip relative to the target element.
30
+ *
31
+ * @default "pointer"
32
+ *
33
+ * @example
34
+ * ```jsx
35
+ * <Tooltip anchorElement="target" />
36
+ * ```
37
+ */
38
+ anchorElement?: string;
39
+ /**
40
+ * Defines the container to which the Tooltip will be appended.
41
+ * Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body).
42
+ * If set to `null`, the Tooltip will not use React Portal.
43
+ *
44
+ * @example
45
+ * ```jsx
46
+ * <Tooltip appendTo={document.getElementById('container')} />
47
+ * ```
48
+ */
49
+ appendTo?: HTMLElement | null;
50
+ /**
51
+ * Sets the position of the Tooltip ([see example](https://www.telerik.com/kendo-react-ui/components/tooltip/tooltip/positioning)).
52
+ *
53
+ * The available options are:
54
+ * - (Default) `auto`&mdash;Automatically positions the Tooltip based on available space.
55
+ * - `right`&mdash;Positions the Tooltip to the right of the element.
56
+ * - `left`&mdash;Positions the Tooltip to the left of the element.
57
+ * - `bottom`&mdash;Positions the Tooltip below the element.
58
+ * - `top`&mdash;Positions the Tooltip above the element.
59
+ *
60
+ * @default "auto"
61
+ *
62
+ * @example
63
+ * ```jsx
64
+ * <Tooltip position="top" />
65
+ * ```
66
+ */
67
+ position?: TooltipPosition;
68
+ /**
69
+ * Specifies additional CSS classes for the Tooltip animation container.
70
+ *
71
+ * @example
72
+ * ```jsx
73
+ * <Tooltip className="custom-tooltip-class" />
74
+ * ```
75
+ */
76
+ className?: string;
77
+ /**
78
+ * Configures when the Tooltip will be displayed.
79
+ * The available options are:
80
+ * - `hover`&mdash;Displays the Tooltip when the mouse hovers over the target element (default).
81
+ * - `click`&mdash;Displays the Tooltip when the target element is clicked.
82
+ * - `focus`&mdash;Displays the Tooltip when the target element is focused.
83
+ * - `keys`&mdash;Displays the Tooltip when a specific key is pressed while the target element is focused.
84
+ * - `none`&mdash;Disables the Tooltip display.
85
+ *
86
+ * @example
87
+ * ```jsx
88
+ * <Tooltip showOption={{ hover: true, click: false }} />
89
+ * ```
90
+ */
91
+ showOption?: TooltipShowOptions;
92
+ /**
93
+ * Sets the content of the Tooltip ([see example](https://www.telerik.com/kendo-react-ui/components/tooltip/tooltip/templates)).
94
+ * Can be a string, JSX, or a function returning JSX.
95
+ *
96
+ * @example
97
+ * ```jsx
98
+ * <Tooltip content="This is a tooltip" />
99
+ * ```
100
+ */
101
+ content?: any;
102
+ /**
103
+ * Specifies the children elements of the Tooltip.
104
+ * Used to define the content of the Tooltip.
105
+ *
106
+ * @example
107
+ * ```jsx
108
+ * <Tooltip>
109
+ * <span>Hover over me</span>
110
+ * </Tooltip>
111
+ * ```
112
+ */
113
+ children?: any;
114
+ /**
115
+ * Controls the visibility of the Tooltip.
116
+ * When set, the Tooltip operates in controlled mode ([see example](https://www.telerik.com/kendo-react-ui/components/tooltip/tooltip/controlled-mode)).
117
+ * Requires the `targetElement` property to be set.
118
+ *
119
+ * @example
120
+ * ```jsx
121
+ * <Tooltip open={true} targetElement={document.getElementById('target')} />
122
+ * ```
123
+ */
124
+ open?: boolean;
125
+ /**
126
+ * Specifies a delay in milliseconds before the Tooltip is displayed.
127
+ *
128
+ * @default 400
129
+ *
130
+ * @example
131
+ * ```jsx
132
+ * <Tooltip openDelay={500} />
133
+ * ```
134
+ */
135
+ openDelay?: number;
136
+ /**
137
+ * Enables the Tooltip to display the title of any parent element with a `title` attribute.
138
+ *
139
+ * @default false
140
+ *
141
+ * @example
142
+ * ```jsx
143
+ * <Tooltip parentTitle={true} />
144
+ * ```
145
+ */
146
+ parentTitle?: boolean;
147
+ /**
148
+ * Determines whether the Tooltip callout (arrow) is displayed.
149
+ *
150
+ * @default true
151
+ *
152
+ * @example
153
+ * ```jsx
154
+ * <Tooltip showCallout={false} />
155
+ * ```
156
+ */
157
+ showCallout?: boolean;
158
+ /**
159
+ * Specifies the starting point of the Tooltip callout when the position is set to `auto`.
160
+ * Accepts a pixel value.
161
+ *
162
+ * @example
163
+ * ```jsx
164
+ * <Tooltip setCalloutOnPositionAuto="50%" />
165
+ * ```
166
+ */
167
+ setCalloutOnPositionAuto?: any;
168
+ /**
169
+ * Specifies the styles applied to the Tooltip animation container.
170
+ *
171
+ * @example
172
+ * ```jsx
173
+ * <Tooltip style={{ backgroundColor: 'blue' }} />
174
+ * ```
175
+ */
176
+ style?: React.CSSProperties;
177
+ /**
178
+ * Specifies the target element for the Tooltip.
179
+ * Required when the Tooltip is in controlled mode.
180
+ *
181
+ * @example
182
+ * ```jsx
183
+ * <Tooltip targetElement={document.getElementById('target')} />
184
+ * ```
185
+ */
186
+ targetElement?: any;
187
+ /**
188
+ * Specifies additional CSS classes for the Tooltip DOM element.
189
+ *
190
+ * @example
191
+ * ```jsx
192
+ * <Tooltip tooltipClassName="custom-tooltip" />
193
+ * ```
194
+ */
195
+ tooltipClassName?: string;
196
+ /**
197
+ * Specifies the styles applied to the Tooltip DOM element.
198
+ *
199
+ * @example
200
+ * ```jsx
201
+ * <Tooltip tooltipStyle={{ color: 'red' }} />
202
+ * ```
203
+ */
204
+ tooltipStyle?: React.CSSProperties;
205
+ /**
206
+ * Fires when the Tooltip is shown.
207
+ * Provides the event details.
208
+ *
209
+ * @example
210
+ * ```jsx
211
+ * <Tooltip onOpen={(event) => console.log('Tooltip opened', event)} />
212
+ * ```
213
+ */
214
+ onOpen?: (event: TooltipEvent) => void;
215
+ /**
216
+ * Fires when the Tooltip is hidden.
217
+ * Provides the event details.
218
+ *
219
+ * @example
220
+ * ```jsx
221
+ * <Tooltip onClose={(event) => console.log('Tooltip closed', event)} />
222
+ * ```
223
+ */
224
+ onClose?: (event: TooltipEvent) => void;
225
+ /**
226
+ * Callback function triggered when the Tooltip calculates its position.
227
+ * Allows customization of the `top` and `left` position values.
228
+ *
229
+ * @example
230
+ * ```jsx
231
+ * <Tooltip onPosition={(event) => ({ top: 100, left: 200 })} />
232
+ * ```
233
+ */
234
+ onPosition?: (event: TooltipPositionEvent) => {
235
+ top: number;
236
+ left: number;
237
+ };
238
+ /**
239
+ * Callback function to determine if the Tooltip should be displayed for a specific target element ([see example](https://www.telerik.com/kendo-react-ui/components/tooltip/tooltip/anchor-elements)).
240
+ *
241
+ * @example
242
+ * ```jsx
243
+ * <Tooltip filter={(target) => target.tagName === 'BUTTON'} />
244
+ * ```
245
+ */
246
+ filter?: (target: HTMLElement) => void;
247
+ /**
248
+ * Specifies the interval in milliseconds for the Tooltip to check for title changes.
249
+ * By default, the Tooltip does not track title updates.
250
+ *
251
+ * @example
252
+ * ```jsx
253
+ * <Tooltip updateInterval={1000} />
254
+ * ```
255
+ */
256
+ updateInterval?: number;
257
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { BaseEvent } from '@progress/kendo-react-common';
9
+ import { Tooltip } from './Tooltip.js';
10
+ import { TooltipPosition } from './utils.js';
11
+ export interface TooltipEvent extends BaseEvent<Tooltip> {
12
+ }
13
+ export interface TooltipPositionEvent extends BaseEvent<Tooltip> {
14
+ /**
15
+ * The Tooltip element. Useful to get the actual `width` and `height` of rendered Tooltip.
16
+ */
17
+ element: HTMLDivElement;
18
+ /**
19
+ * The current target element. Useful to calculate `top` and `left` position of the Tooltip element.
20
+ */
21
+ targetElement: HTMLElement | null;
22
+ /**
23
+ * The current mouse `top` position;
24
+ */
25
+ mouseTop: number;
26
+ /**
27
+ * The current mouse `left` position.
28
+ */
29
+ mouseLeft: number;
30
+ /**
31
+ * The Tooltip anchor element prop.
32
+ */
33
+ anchorElement?: string;
34
+ /**
35
+ * The Tooltip position prop.
36
+ */
37
+ position?: TooltipPosition;
38
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ /**
9
+ * @hidden
10
+ */
11
+ export type TooltipPosition = 'right' | 'left' | 'bottom' | 'top' | 'auto';
12
+ /**
13
+ * Specifies when the options of the [showTooltip](https://www.telerik.com/kendo-react-ui/components/tooltip/api/tooltipprops#toc-showoption) props.
14
+ * - `hover`&mdash;Shows the Tooltip when the mouse hovers over the target element(Set to `true` by default).
15
+ * - `click`&mdash;Shows the Tooltip when the target element is clicked(Set to `false` by default).
16
+ * - `focus`&mdash;Shows the Tooltip when the target element is focused(Set to `false` by default).
17
+ * - `keys`&mdash;Shows the Tooltip when the target element is focused and a specific key is pressed(Set to `false` by default).
18
+ * - `none`&mdash;Doesn't show the Tooltip(Set to `false` by default).
19
+ */
20
+ export type TooltipShowOptions = {
21
+ hover?: boolean;
22
+ click?: boolean;
23
+ focus?: boolean;
24
+ keys?: string[];
25
+ none?: boolean;
26
+ };
27
+ /**
28
+ * @hidden
29
+ */
30
+ export declare const getLeftPosition: (left: any, elementWidth: any, targetElement: any, anchorElement: any, position: any) => any;
31
+ /**
32
+ * @hidden
33
+ */
34
+ export declare const getTopPosition: (top: any, targetElement: any, elementHeight: any, anchorElement: any, position: any) => any;
35
+ /**
36
+ * @hidden
37
+ */
38
+ export declare const getDomRect: (currentTarget: any) => any;
39
+ /**
40
+ * @hidden
41
+ */
42
+ export declare const toolTipSelectors: string[];
43
+ /**
44
+ * @hidden
45
+ */
46
+ export declare const isTooltipElement: (element: any) => boolean;