@neo4j-ndl/react 1.0.1 → 1.0.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.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/_common/ConditionalWrap.js +31 -0
- package/lib/cjs/_common/ConditionalWrap.js.map +1 -0
- package/lib/cjs/tooltip/SmartTooltip.js +4 -2
- package/lib/cjs/tooltip/SmartTooltip.js.map +1 -1
- package/lib/esm/_common/ConditionalWrap.js +27 -0
- package/lib/esm/_common/ConditionalWrap.js.map +1 -0
- package/lib/esm/tooltip/SmartTooltip.js +4 -2
- package/lib/esm/tooltip/SmartTooltip.js.map +1 -1
- package/lib/types/_common/ConditionalWrap.d.ts +30 -0
- package/lib/types/tooltip/SmartTooltip.d.ts +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.ConditionalWrap = void 0;
|
|
24
|
+
/**
|
|
25
|
+
* Component to enable conditional
|
|
26
|
+
* wrapping of components
|
|
27
|
+
*/
|
|
28
|
+
const ConditionalWrap = ({ condition, wrap, children, }) => (condition ? wrap(children) : children);
|
|
29
|
+
exports.ConditionalWrap = ConditionalWrap;
|
|
30
|
+
exports.default = exports.ConditionalWrap;
|
|
31
|
+
//# sourceMappingURL=ConditionalWrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionalWrap.js","sourceRoot":"","sources":["../../../src/_common/ConditionalWrap.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH;;;GAGG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EACT,IAAI,EACJ,QAAQ,GAKT,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AARjC,QAAA,eAAe,mBAQkB;AAE9C,kBAAe,uBAAe,CAAC"}
|
|
@@ -62,6 +62,8 @@ const react_1 = __importStar(require("react"));
|
|
|
62
62
|
const react_dom_interactions_1 = require("@floating-ui/react-dom-interactions");
|
|
63
63
|
const Tooltip_1 = __importDefault(require("./Tooltip"));
|
|
64
64
|
const base_1 = require("@neo4j-ndl/base");
|
|
65
|
+
const portal_1 = require("../portal");
|
|
66
|
+
const ConditionalWrap_1 = __importDefault(require("../_common/ConditionalWrap"));
|
|
65
67
|
const PLACEMENTS = ['top', 'bottom', 'left', 'right'];
|
|
66
68
|
const calculateArrow = (placement) => {
|
|
67
69
|
switch (placement) {
|
|
@@ -77,7 +79,7 @@ const calculateArrow = (placement) => {
|
|
|
77
79
|
}
|
|
78
80
|
};
|
|
79
81
|
const SmartTooltip = react_1.default.forwardRef(function SmartTooltip(_a, ref) {
|
|
80
|
-
var { open: openProp, allowedPlacements = PLACEMENTS } = _a, props = __rest(_a, ["open", "allowedPlacements"]);
|
|
82
|
+
var { open: openProp, allowedPlacements = PLACEMENTS, portal = true } = _a, props = __rest(_a, ["open", "allowedPlacements", "portal"]);
|
|
81
83
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
82
84
|
const { context, x, y, reference, floating, strategy, placement } = (0, react_dom_interactions_1.useFloating)({
|
|
83
85
|
open,
|
|
@@ -108,7 +110,7 @@ const SmartTooltip = react_1.default.forwardRef(function SmartTooltip(_a, ref) {
|
|
|
108
110
|
reference(current);
|
|
109
111
|
}
|
|
110
112
|
}, [ref]);
|
|
111
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: open || openProp ? ((0, jsx_runtime_1.jsx)(Tooltip_1.default, Object.assign({}, props, getFloatingProps(), { ref: floating, arrowPosition: calculateArrow(placement), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content' }, props.style) }))) : null }));
|
|
113
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: open || openProp ? ((0, jsx_runtime_1.jsx)(ConditionalWrap_1.default, Object.assign({ condition: portal, wrap: (children) => (0, jsx_runtime_1.jsx)(portal_1.Portal, { children: children }) }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.default, Object.assign({}, props, getFloatingProps(), { ref: floating, arrowPosition: calculateArrow(placement), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content' }, props.style) })) }))) : null }));
|
|
112
114
|
});
|
|
113
115
|
exports.default = SmartTooltip;
|
|
114
116
|
//# sourceMappingURL=SmartTooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartTooltip.js","sourceRoot":"","sources":["../../../src/tooltip/SmartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+C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AC;AAEH,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Component to enable conditional
|
|
23
|
+
* wrapping of components
|
|
24
|
+
*/
|
|
25
|
+
export const ConditionalWrap = ({ condition, wrap, children, }) => (condition ? wrap(children) : children);
|
|
26
|
+
export default ConditionalWrap;
|
|
27
|
+
//# sourceMappingURL=ConditionalWrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionalWrap.js","sourceRoot":"","sources":["../../../src/_common/ConditionalWrap.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EACT,IAAI,EACJ,QAAQ,GAKT,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAE9C,eAAe,eAAe,CAAC"}
|
|
@@ -34,6 +34,8 @@ import React, { useEffect, useState, } from 'react';
|
|
|
34
34
|
import { useFloating, offset, autoPlacement, autoUpdate, useHover, useInteractions, } from '@floating-ui/react-dom-interactions';
|
|
35
35
|
import Tooltip from './Tooltip';
|
|
36
36
|
import { tokens } from '@neo4j-ndl/base';
|
|
37
|
+
import { Portal } from '../portal';
|
|
38
|
+
import ConditionalWrap from '../_common/ConditionalWrap';
|
|
37
39
|
const PLACEMENTS = ['top', 'bottom', 'left', 'right'];
|
|
38
40
|
const calculateArrow = (placement) => {
|
|
39
41
|
switch (placement) {
|
|
@@ -49,7 +51,7 @@ const calculateArrow = (placement) => {
|
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
const SmartTooltip = React.forwardRef(function SmartTooltip(_a, ref) {
|
|
52
|
-
var { open: openProp, allowedPlacements = PLACEMENTS } = _a, props = __rest(_a, ["open", "allowedPlacements"]);
|
|
54
|
+
var { open: openProp, allowedPlacements = PLACEMENTS, portal = true } = _a, props = __rest(_a, ["open", "allowedPlacements", "portal"]);
|
|
53
55
|
const [open, setOpen] = useState(false);
|
|
54
56
|
const { context, x, y, reference, floating, strategy, placement } = useFloating({
|
|
55
57
|
open,
|
|
@@ -80,7 +82,7 @@ const SmartTooltip = React.forwardRef(function SmartTooltip(_a, ref) {
|
|
|
80
82
|
reference(current);
|
|
81
83
|
}
|
|
82
84
|
}, [ref]);
|
|
83
|
-
return (_jsx(_Fragment, { children: open || openProp ? (_jsx(Tooltip, Object.assign({}, props, getFloatingProps(), { ref: floating, arrowPosition: calculateArrow(placement), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content' }, props.style) }))) : null }));
|
|
85
|
+
return (_jsx(_Fragment, { children: open || openProp ? (_jsx(ConditionalWrap, Object.assign({ condition: portal, wrap: (children) => _jsx(Portal, { children: children }) }, { children: _jsx(Tooltip, Object.assign({}, props, getFloatingProps(), { ref: floating, arrowPosition: calculateArrow(placement), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content' }, props.style) })) }))) : null }));
|
|
84
86
|
});
|
|
85
87
|
export default SmartTooltip;
|
|
86
88
|
//# sourceMappingURL=SmartTooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartTooltip.js","sourceRoot":"","sources":["../../../src/tooltip/SmartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,MAAM,EACN,aAAa,EACb,UAAU,EACV,QAAQ,EACR,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,OAAyB,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SmartTooltip.js","sourceRoot":"","sources":["../../../src/tooltip/SmartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,MAAM,EACN,aAAa,EACb,UAAU,EACV,QAAQ,EACR,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,OAAyB,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAczD,MAAM,UAAU,GAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9D,MAAM,cAAc,GAAG,CACrB,S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AAG,IAAI,EAAE,GAAI,GAA6B,IAAI,EAAE,CAAC;QAChE,IAAI,OAAO,EAAE;YACX,SAAS,CAAC,OAAO,CAAC,CAAC;SACpB;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,CACL,4BACG,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,CAClB,KAAC,eAAe,kBACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAC,MAAM,cAAE,QAAQ,GAAU,gBAE/C,KAAC,OAAO,oBACF,KAAK,EACL,gBAAgB,EAAE,IACtB,GAAG,EAAE,QAAQ,EACb,aAAa,EAAE,cAAc,CAAC,SAAiB,CAAC,EAChD,KAAK,kBACH,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,CAAC,EACX,IAAI,EAAE,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,CAAC,EACZ,KAAK,EAAE,aAAa,IACjB,KAAK,CAAC,KAAK,KAEhB,IACc,CACnB,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Component to enable conditional
|
|
23
|
+
* wrapping of components
|
|
24
|
+
*/
|
|
25
|
+
export declare const ConditionalWrap: ({ condition, wrap, children, }: {
|
|
26
|
+
condition: boolean;
|
|
27
|
+
wrap: (childre: JSX.Element) => JSX.Element;
|
|
28
|
+
children: JSX.Element;
|
|
29
|
+
}) => JSX.Element;
|
|
30
|
+
export default ConditionalWrap;
|
|
@@ -26,6 +26,11 @@ export interface SmartTooltipProps extends Omit<TooltipProps, 'arrowPosition'> {
|
|
|
26
26
|
allowedPlacements?: Side[];
|
|
27
27
|
/** If you want controlled open/close behavior pass an open prop */
|
|
28
28
|
open?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If the tooltip is being cut-off by a parent element,
|
|
31
|
+
* it will render in a Portal targeting body
|
|
32
|
+
*/
|
|
33
|
+
portal?: boolean;
|
|
29
34
|
}
|
|
30
|
-
declare const SmartTooltip: React.ForwardRefExoticComponent<Pick<SmartTooltipProps, "size" | "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "list" | "children" | "role" | "as" | "selected" | "onChange" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "allowedPlacements"> & React.RefAttributes<unknown>>;
|
|
35
|
+
declare const SmartTooltip: React.ForwardRefExoticComponent<Pick<SmartTooltipProps, "size" | "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "list" | "children" | "role" | "as" | "selected" | "onChange" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "allowedPlacements" | "portal"> & React.RefAttributes<unknown>>;
|
|
31
36
|
export default SmartTooltip;
|