1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { __assign, __extends, __rest } from "tslib";
|
17 | import classNames from "classnames";
|
18 | import * as React from "react";
|
19 | import { AbstractPureComponent2, Classes } from "../../common";
|
20 | import { DISPLAYNAME_PREFIX } from "../../common/props";
|
21 |
|
22 | import { Popover, PopoverInteractionKind } from "../popover/popover";
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | var Tooltip = (function (_super) {
|
31 | __extends(Tooltip, _super);
|
32 | function Tooltip() {
|
33 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
34 |
|
35 | _this.popover = null;
|
36 | return _this;
|
37 | }
|
38 | Tooltip.prototype.render = function () {
|
39 | var _a;
|
40 | var _this = this;
|
41 | var _b = this.props, children = _b.children, intent = _b.intent, popoverClassName = _b.popoverClassName, restProps = __rest(_b, ["children", "intent", "popoverClassName"]);
|
42 | var classes = classNames(Classes.TOOLTIP, (_a = {}, _a[Classes.MINIMAL] = this.props.minimal, _a), Classes.intentClass(intent), popoverClassName);
|
43 | return (
|
44 |
|
45 | React.createElement(Popover, __assign({ interactionKind: PopoverInteractionKind.HOVER_TARGET_ONLY, modifiers: { arrow: { enabled: !this.props.minimal } } }, restProps, { autoFocus: false, canEscapeKeyClose: false, enforceFocus: false, lazy: true, popoverClassName: classes, portalContainer: this.props.portalContainer, ref: function (ref) { return (_this.popover = ref); } }), children));
|
46 | };
|
47 | Tooltip.prototype.reposition = function () {
|
48 | if (this.popover != null) {
|
49 | this.popover.reposition();
|
50 | }
|
51 | };
|
52 | Tooltip.displayName = "".concat(DISPLAYNAME_PREFIX, ".Tooltip");
|
53 |
|
54 | Tooltip.defaultProps = {
|
55 | hoverCloseDelay: 0,
|
56 | hoverOpenDelay: 100,
|
57 | minimal: false,
|
58 | transitionDuration: 100,
|
59 | };
|
60 | return Tooltip;
|
61 | }(AbstractPureComponent2));
|
62 | export { Tooltip };
|
63 |
|
\ | No newline at end of file |