@infomaximum/ui-kit 0.15.6 → 0.15.8
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/dist/components/BaseSelect/components/SelectOptionList/SelectOptionList.styles.d.ts +1 -1
- package/dist/components/BaseTooltip/BaseTooltip.js +59 -21
- package/dist/components/BaseTooltip/BaseTooltip.styles.d.ts +27 -1
- package/dist/components/BaseTooltip/BaseTooltip.styles.js +2 -1
- package/dist/components/BaseTooltip/BaseTooltip.types.d.ts +8 -2
- package/dist/components/BaseTooltip/BaseTooltip.utils.d.ts +26 -3
- package/dist/components/BaseTooltip/BaseTooltip.utils.js +87 -7
- package/dist/components/BaseTooltip/hooks/useCustomFloating.d.ts +4 -3
- package/dist/components/BaseTooltip/hooks/useCustomFloating.js +22 -23
- package/dist/components/BaseTooltip/hooks/useShowTooltipController.d.ts +11 -9
- package/dist/components/BaseTooltip/hooks/useShowTooltipController.js +21 -10
- package/dist/components/BaseTooltip/hooks/useTargetRefController.d.ts +17 -0
- package/dist/components/BaseTooltip/hooks/useTargetRefController.js +36 -0
- package/dist/components/Button/Button.js +11 -4
- package/dist/components/Button/Button.styles.js +1 -2
- package/dist/components/Dropdown/components/SubMenu/SubMenu.js +3 -3
- package/dist/components/InternalPicker/styles/DatePanel.styles.d.ts +2 -2
- package/dist/components/InternalPicker/styles/Popup.styles.d.ts +2 -2
- package/dist/components/Message/components/Message/Message.js +7 -4
- package/dist/components/Popconfirm/Popconfirm.js +4 -0
- package/dist/components/Popconfirm/components/PopconfirmFloatingElement/PopconfirmFloatingElement.styles.d.ts +11 -9
- package/dist/components/Popconfirm/components/PopconfirmFloatingElement/PopconfirmFloatingElement.styles.js +2 -0
- package/dist/components/Popover/Popover.js +4 -0
- package/dist/components/Popover/component/PopoverFloatingElement/PopoverFloatingElement.styles.d.ts +11 -9
- package/dist/components/Popover/component/PopoverFloatingElement/PopoverFloatingElement.styles.js +2 -0
- package/dist/components/Tabs/components/TabItem/TabItem.styles.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +4 -0
- package/dist/components/Tooltip/components/TooltipFloatingElement/TooltipFloatingElement.styles.d.ts +13 -12
- package/dist/components/Tooltip/components/TooltipFloatingElement/TooltipFloatingElement.styles.js +1 -0
- package/dist/hooks/useLoadingDelay.js +7 -4
- package/dist/utils/const/index.d.ts +1 -0
- package/dist/utils/const/index.js +3 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ export declare const getSelectOptionListStyle: ({ dropdownMinWidth, dropdownMaxH
|
|
|
22
22
|
readonly width: number | "fit-content";
|
|
23
23
|
readonly maxHeight: number;
|
|
24
24
|
readonly height: "fit-content";
|
|
25
|
-
readonly visibility: "
|
|
25
|
+
readonly visibility: "visible" | "hidden";
|
|
26
26
|
readonly boxSizing: "border-box";
|
|
27
27
|
readonly borderRadius: 8;
|
|
28
28
|
readonly background: "#FFFFFF";
|
|
@@ -6,6 +6,8 @@ import { createPortal } from "react-dom";
|
|
|
6
6
|
import { useShowTooltipController } from "./hooks/useShowTooltipController.js";
|
|
7
7
|
import { baseTooltipReferenceWrapperStyle, getBaseTooltipFloatingWrapperStyle } from "./BaseTooltip.styles.js";
|
|
8
8
|
import { useCustomFloating } from "./hooks/useCustomFloating.js";
|
|
9
|
+
import { useTargetRefController } from "./hooks/useTargetRefController.js";
|
|
10
|
+
import { isNil, isFunction, isNull } from "lodash-es";
|
|
9
11
|
import { useTheme } from "../../hooks/useTheme/useTheme.js";
|
|
10
12
|
const BaseTooltip = memo(({
|
|
11
13
|
floatingElement,
|
|
@@ -26,53 +28,71 @@ const BaseTooltip = memo(({
|
|
|
26
28
|
children,
|
|
27
29
|
styles,
|
|
28
30
|
withoutWrapper,
|
|
29
|
-
|
|
31
|
+
showInCursorPosition = false,
|
|
32
|
+
getPopupContainer = () => document.body,
|
|
33
|
+
getTargetDOMNode
|
|
30
34
|
}) => {
|
|
31
35
|
var _a;
|
|
32
36
|
const theme = useTheme();
|
|
37
|
+
const currentTransform = transform && !showInCursorPosition;
|
|
33
38
|
const {
|
|
34
39
|
refs,
|
|
35
40
|
floatingStyles,
|
|
36
41
|
context,
|
|
37
42
|
floatingPlacement,
|
|
38
|
-
setArrowRef
|
|
43
|
+
setArrowRef,
|
|
44
|
+
arrowRef
|
|
39
45
|
} = useCustomFloating({
|
|
40
46
|
placement,
|
|
41
47
|
autoAdjustOverflow,
|
|
42
48
|
withArrow,
|
|
43
49
|
align,
|
|
44
|
-
transform
|
|
50
|
+
transform: currentTransform
|
|
45
51
|
});
|
|
46
52
|
const {
|
|
47
53
|
isOpen,
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
handlePointerEnter,
|
|
55
|
+
handlePointerLeave,
|
|
50
56
|
handleFocus,
|
|
51
57
|
handleBlur,
|
|
52
58
|
handleClick,
|
|
53
59
|
handleContextMenu,
|
|
54
|
-
|
|
60
|
+
handlePointerUp
|
|
55
61
|
} = useShowTooltipController({
|
|
56
62
|
trigger,
|
|
57
63
|
defaultOpen,
|
|
58
64
|
open,
|
|
59
65
|
mouseEnterDelay,
|
|
60
66
|
mouseLeaveDelay,
|
|
67
|
+
showInCursorPosition,
|
|
68
|
+
placement: floatingPlacement,
|
|
61
69
|
refs,
|
|
62
|
-
onOpenChange
|
|
70
|
+
onOpenChange,
|
|
71
|
+
arrowRef
|
|
63
72
|
});
|
|
64
|
-
const
|
|
73
|
+
const {
|
|
74
|
+
setTargetRef
|
|
75
|
+
} = useTargetRefController({
|
|
76
|
+
getTargetDOMNode,
|
|
77
|
+
refs,
|
|
78
|
+
handlePointerEnter,
|
|
79
|
+
handlePointerLeave,
|
|
80
|
+
handleFocus,
|
|
81
|
+
handleBlur,
|
|
82
|
+
handleClick,
|
|
83
|
+
handleContextMenu,
|
|
84
|
+
handlePointerUp
|
|
85
|
+
});
|
|
86
|
+
const arrowPlacementCorrection = getArrowPlacementCorrection(floatingPlacement, refs, align);
|
|
65
87
|
const renderFloatingElement = () => {
|
|
66
88
|
var _a2;
|
|
67
|
-
return /* @__PURE__ */ jsxs("div", { ref: refs.setFloating, css: [getBaseTooltipFloatingWrapperStyle(floatingPlacement, withArrow), (_a2 = styles == null ? void 0 : styles.floatingWrapper) == null ? void 0 : _a2.call(styles, theme), process.env.NODE_ENV === "production" ? "" : ";label:renderFloatingElement;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
89
|
+
return /* @__PURE__ */ jsxs("div", { ref: refs.setFloating, css: [getBaseTooltipFloatingWrapperStyle(floatingPlacement, withArrow, isOpen), (_a2 = styles == null ? void 0 : styles.floatingWrapper) == null ? void 0 : _a2.call(styles, theme), process.env.NODE_ENV === "production" ? "" : ";label:renderFloatingElement;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvQmFzZVRvb2x0aXAvQmFzZVRvb2x0aXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdHVSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL0Jhc2VUb29sdGlwL0Jhc2VUb29sdGlwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyB0eXBlIEZDLCBtZW1vLCB0eXBlIFByb3BzV2l0aENoaWxkcmVuLCB1c2VNZW1vIH0gZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQgdHlwZSB7IEJhc2VUb29sdGlwUHJvcHMsIEJhc2VUb29sdGlwVHJpZ2dlclR5cGUgfSBmcm9tIFwiLi9CYXNlVG9vbHRpcC50eXBlc1wiO1xuaW1wb3J0IHsgRmxvYXRpbmdBcnJvdyB9IGZyb20gXCJAZmxvYXRpbmctdWkvcmVhY3RcIjtcbmltcG9ydCB7XG4gIEF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IHJlZj17cmVmcy5zZXRGbG9hdGluZ31cbiAgICAgICAgICBjc3M9e1tcbiAgICAgICAgICAgIGdldEJhc2VUb29sdGlwRmxvYXRpbmdXcmFwcGVyU3R5bGUoZmxvYXRpbmdQbGFjZW1lbnQsIHdpdGhBcnJvdywgaXNPcGVuKSxcbiAgICAgICAgICAgIHN0eWxlcz8uZmxvYXRpbmdXcmFwcGVyPy4odGhlbWUpLFxuICAgICAgICAgIF19XG4gICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgIC4uLmZsb2F0aW5nU3R5bGVzLFxuICAgICAgICAgICAgd2lkdGg6ICFjdXJyZW50VHJhbnNmb3JtID8gXCJtYXgtY29udGVudFwiIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgekluZGV4LFxuICAgICAgICAgIH19XG4gICAgICAgICAgY2xhc3NOYW1lPXtjbGFzc05hbWV9XG4gICAgICAgID5cbiAgICAgICAgICB7ZmxvYXRpbmdFbGVtZW50fVxuICAgICAgICAgIHt3aXRoQXJyb3cgJiYgKFxuICAgICAgICAgICAgPEZsb2F0aW5nQXJyb3dcbiAgICAgICAgICAgICAgcmVmPXtzZXRBcnJvd1JlZn1cbiAgICAgICAgICAgICAgY29udGV4dD17Y29udGV4dH1cbiAgICAgICAgICAgICAgd2lkdGg9e0FSUk9XX1dJRFRIfVxuICAgICAgICAgICAgICBoZWlnaHQ9e0FSUk9XX0hFSUdIVH1cbiAgICAgICAgICAgICAgZmlsbD17YXJyb3dDb2xvcn1cbiAgICAgICAgICAgICAgc3R5bGU9e2Fycm93UGxhY2VtZW50Q29ycmVjdGlvbn1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgKX1cbiAgICAgICAgPC9kaXY+XG4gICAgICApO1xuICAgIH07XG5cbiAgICBjb25zdCBjaGlsZHJlbldpdGhQcm9wcyA9IHVzZU1lbW8oKCkgPT4ge1xuICAgICAgaWYgKCF3aXRob3V0V3JhcHBlcikge1xuICAgICAgICByZXR1cm4gY2hpbG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cbiAgICAgICk7XG4gICAgfVxuXG4gICAgaWYgKHdpdGhvdXRXcmFwcGVyKSB7XG4gICAgICByZXR1cm4gKFxuICAgICAgICA8PlxuICAgICAgICAgIHtjaGlsZHJlbldpdGhQcm9wc31cbiAgICAgICAgICB7Z2V0RmxvYXRpbmdFbGVtZW50KCl9XG4gICAgICAgIDwvPlxuICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4gKFxuICAgICAgPGRpdlxuICAgICAgICByZWY9e3NldFRhcmdldFJlZn1cbiAgICAgICAgY3NzPXtbYmFzZVRvb2x0aXBSZWZlcmVuY2VXcmFwcGVyU3R5bGUsIHN0eWxlcz8ucmVmZXJlbmNlV3JhcHBlcj8uKHRoZW1lKV19XG4gICAgICAgIG9uUG9pbnRlckVudGVyPXtoYW5kbGVQb2ludGVyRW50ZXJ9XG4gICAgICAgIG9uUG9pbnRlckxlYXZlPXtoYW5kbGVQb2ludGVyTGVhdmV9XG4gICAgICAgIG9uRm9jdXM9e2hhbmRsZUZvY3VzfVxuICAgICAgICBvbkJsdXI9e2hhbmRsZUJsdXJ9XG4gICAgICAgIG9uQ2xpY2s9e2hhbmRsZUNsaWNrfVxuICAgICAgICBvbkNvbnRleHRNZW51PXtoYW5kbGVDb250ZXh0TWVudX1cbiAgICAgICAgb25Qb2ludGVyVXA9e2hhbmRsZVBvaW50ZXJVcH1cbiAgICAgID5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgICB7Z2V0RmxvYXRpbmdFbGVtZW50KCl9XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG4pO1xuIl19 */"], style: {
|
|
68
90
|
...floatingStyles,
|
|
69
|
-
width: !
|
|
91
|
+
width: !currentTransform ? "max-content" : void 0,
|
|
70
92
|
zIndex
|
|
71
93
|
}, className, children: [
|
|
72
94
|
floatingElement,
|
|
73
|
-
withArrow && /* @__PURE__ */ jsx(FloatingArrow, { ref: setArrowRef, context, width: ARROW_WIDTH, height: ARROW_HEIGHT, fill: arrowColor, style:
|
|
74
|
-
...arrowPlacementCorrection
|
|
75
|
-
} })
|
|
95
|
+
withArrow && /* @__PURE__ */ jsx(FloatingArrow, { ref: setArrowRef, context, width: ARROW_WIDTH, height: ARROW_HEIGHT, fill: arrowColor, style: arrowPlacementCorrection })
|
|
76
96
|
] });
|
|
77
97
|
};
|
|
78
98
|
const childrenWithProps = useMemo(() => {
|
|
@@ -88,26 +108,44 @@ const BaseTooltip = memo(({
|
|
|
88
108
|
addedPropsCounter += 1;
|
|
89
109
|
return React.cloneElement(child, {
|
|
90
110
|
...child.props,
|
|
91
|
-
ref:
|
|
92
|
-
|
|
93
|
-
|
|
111
|
+
ref: setTargetRef,
|
|
112
|
+
onPointerEnter: handlePointerEnter ?? ((_a2 = child == null ? void 0 : child.props) == null ? void 0 : _a2.onPointerEnter),
|
|
113
|
+
onPointerLeave: handlePointerLeave ?? ((_b = child == null ? void 0 : child.props) == null ? void 0 : _b.onPointerLeave),
|
|
94
114
|
onFocus: handleFocus ?? ((_c = child == null ? void 0 : child.props) == null ? void 0 : _c.onFocus),
|
|
95
115
|
onBlur: handleBlur ?? ((_d = child == null ? void 0 : child.props) == null ? void 0 : _d.onBlur),
|
|
96
116
|
onClick: handleClick ?? ((_e = child == null ? void 0 : child.props) == null ? void 0 : _e.onClick),
|
|
97
117
|
onContextMenu: handleContextMenu ?? ((_f = child == null ? void 0 : child.props) == null ? void 0 : _f.onContextMenu),
|
|
98
|
-
|
|
118
|
+
onPointerUp: handlePointerUp ?? ((_g = child == null ? void 0 : child.props) == null ? void 0 : _g.onPointerUp)
|
|
99
119
|
});
|
|
100
120
|
});
|
|
101
|
-
}, [children, handleBlur, handleClick, handleContextMenu, handleFocus,
|
|
121
|
+
}, [children, handleBlur, handleClick, handleContextMenu, handleFocus, handlePointerEnter, handlePointerLeave, handlePointerUp, setTargetRef, withoutWrapper]);
|
|
122
|
+
const getFloatingElement = () => {
|
|
123
|
+
if (!isOpen && !showInCursorPosition) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
return createPortal(renderFloatingElement(), getPopupContainer(refs.domReference.current ?? document.body));
|
|
127
|
+
};
|
|
128
|
+
if (isNil(getTargetDOMNode) && isNil(children)) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
if (isFunction(getTargetDOMNode)) {
|
|
132
|
+
if (isNull(getTargetDOMNode())) {
|
|
133
|
+
return children;
|
|
134
|
+
}
|
|
135
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
136
|
+
children,
|
|
137
|
+
getFloatingElement()
|
|
138
|
+
] });
|
|
139
|
+
}
|
|
102
140
|
if (withoutWrapper) {
|
|
103
141
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
142
|
childrenWithProps,
|
|
105
|
-
|
|
143
|
+
getFloatingElement()
|
|
106
144
|
] });
|
|
107
145
|
}
|
|
108
|
-
return /* @__PURE__ */ jsxs("div", { ref:
|
|
146
|
+
return /* @__PURE__ */ jsxs("div", { ref: setTargetRef, css: [baseTooltipReferenceWrapperStyle, (_a = styles == null ? void 0 : styles.referenceWrapper) == null ? void 0 : _a.call(styles, theme), process.env.NODE_ENV === "production" ? "" : ";label:BaseTooltip;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvQmFzZVRvb2x0aXAvQmFzZVRvb2x0aXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlNUSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL0Jhc2VUb29sdGlwL0Jhc2VUb29sdGlwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyB0eXBlIEZDLCBtZW1vLCB0eXBlIFByb3BzV2l0aEN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vaW50ZXJVcCxcbiAgICB9KTtcblxuICAgIGNvbnN0IGFycm93UGxhY2VtZW50Q29ycmVjdGlvbiA9IGdldEFycm93UGxhY2VtZW50Q29ycmVjdGlvbihmbG9hdGluZ1BsYWNlbWVudCwgcmVmcywgYWxpZ24pO1xuXG4gICAgY29uc3QgcmVuZGVyRmxvYXRpbmdFbGVtZW50ID0gKCkgPT4ge1xuICAgICAgcmV0dXJuIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIHJlZj17cmVmcy5zZXRGbG9hdGluZ31cbiAgICAgICAgICBjc3M9e1tcbiAgICAgICAgICAgIGdldEJhc2VUb29sdGlwRmxvYXRpbmdXcmFwcGVyU3R5bGUoZmxvYXRpbmdQbGFjZW1lbnQsIHdpdGhBcnJvdywgaXNPcGVuKSxcbiAgICAgICAgICAgIHN0eWxlcz8uZmxvYXRpbmdXcmFwcGVyPy4odGhlbWUpLFxuICAgICAgICAgIF19XG4gICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgIC4uLmZsb2F0aW5nU3R5bGVzLFxuICAgICAgICAgICAgd2lkdGg6ICFjdXJyZW50VHJhbnNmb3JtID8gXCJtYXgtY29udGVudFwiIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgekluZGV4LFxuICAgICAgICAgIH19XG4gICAgICAgICAgY2xhc3NOYW1lPXtjbGFzc05hbWV9XG4gICAgICAgID5cbiAgICAgICAgICB7ZmxvYXRpbmdFbGVtZW50fVxuICAgICAgICAgIHt3aXRoQXJyb3cgJiYgKFxuICAgICAgICAgICAgPEZsb2F0aW5nQXJyb3dcbiAgICAgICAgICAgICAgcmVmPXtzZXRBcnJvd1JlZn1cbiAgICAgICAgICAgICAgY29udGV4dD17Y29udGV4dH1cbiAgICAgICAgICAgICAgd2lkdGg9e0FSUk9XX1dJRFRIfVxuICAgICAgICAgICAgICBoZWlnaHQ9e0FSUk9XX0hFSUdIVH1cbiAgICAgICAgICAgICAgZmlsbD17YXJyb3dDb2xvcn1cbi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l9XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG4pO1xuIl19 */"], onPointerEnter: handlePointerEnter, onPointerLeave: handlePointerLeave, onFocus: handleFocus, onBlur: handleBlur, onClick: handleClick, onContextMenu: handleContextMenu, onPointerUp: handlePointerUp, children: [
|
|
109
147
|
children,
|
|
110
|
-
|
|
148
|
+
getFloatingElement()
|
|
111
149
|
] });
|
|
112
150
|
});
|
|
113
151
|
export {
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/react';
|
|
2
|
-
export declare const getBaseTooltipFloatingWrapperStyle: (placement: Placement, withArrow: boolean) => {
|
|
2
|
+
export declare const getBaseTooltipFloatingWrapperStyle: (placement: Placement, withArrow: boolean, isOpen: boolean) => {
|
|
3
|
+
readonly visibility: "visible" | "hidden";
|
|
4
|
+
} | {
|
|
5
|
+
readonly paddingBottom: number;
|
|
6
|
+
readonly paddingTop?: undefined;
|
|
7
|
+
readonly paddingRight?: undefined;
|
|
8
|
+
readonly paddingLeft?: undefined;
|
|
9
|
+
readonly visibility: "visible" | "hidden";
|
|
10
|
+
} | {
|
|
11
|
+
readonly paddingTop: number;
|
|
12
|
+
readonly paddingBottom?: undefined;
|
|
13
|
+
readonly paddingRight?: undefined;
|
|
14
|
+
readonly paddingLeft?: undefined;
|
|
15
|
+
readonly visibility: "visible" | "hidden";
|
|
16
|
+
} | {
|
|
17
|
+
readonly paddingRight: number;
|
|
18
|
+
readonly paddingBottom?: undefined;
|
|
19
|
+
readonly paddingTop?: undefined;
|
|
20
|
+
readonly paddingLeft?: undefined;
|
|
21
|
+
readonly visibility: "visible" | "hidden";
|
|
22
|
+
} | {
|
|
23
|
+
readonly paddingLeft: number;
|
|
24
|
+
readonly paddingBottom?: undefined;
|
|
25
|
+
readonly paddingTop?: undefined;
|
|
26
|
+
readonly paddingRight?: undefined;
|
|
27
|
+
readonly visibility: "visible" | "hidden";
|
|
28
|
+
};
|
|
3
29
|
export declare const baseTooltipReferenceWrapperStyle: {
|
|
4
30
|
display: string;
|
|
5
31
|
width: string;
|
|
@@ -23,8 +23,9 @@ const getPadding = (placement, withArrow) => {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const getBaseTooltipFloatingWrapperStyle = (placement, withArrow) => {
|
|
26
|
+
const getBaseTooltipFloatingWrapperStyle = (placement, withArrow, isOpen) => {
|
|
27
27
|
return {
|
|
28
|
+
visibility: isOpen ? "visible" : "hidden",
|
|
28
29
|
...getPadding(placement, withArrow)
|
|
29
30
|
};
|
|
30
31
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Interpolation } from '@emotion/react';
|
|
2
|
-
import {
|
|
2
|
+
import { FloatingElement, ReferenceElement } from '@floating-ui/react';
|
|
3
|
+
import { MouseEvent, PointerEvent, ReactNode } from 'react';
|
|
3
4
|
import { Theme } from 'themes';
|
|
4
5
|
export type BaseTooltipPlacementType = "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
5
6
|
export type BaseTooltipTriggerType = "hover" | "focus" | "click" | "contextMenu";
|
|
@@ -28,10 +29,15 @@ export interface BaseTooltipProps {
|
|
|
28
29
|
align?: BaseTooltipAlign;
|
|
29
30
|
transform?: boolean;
|
|
30
31
|
withoutWrapper?: boolean;
|
|
32
|
+
showInCursorPosition?: boolean;
|
|
33
|
+
getTargetDOMNode?: () => HTMLElement | null;
|
|
31
34
|
styles?: {
|
|
32
35
|
floatingWrapper?: (theme: Theme) => Interpolation;
|
|
33
36
|
referenceWrapper?: (theme: Theme) => Interpolation;
|
|
34
37
|
};
|
|
35
|
-
getPopupContainer?: () => HTMLElement;
|
|
38
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
36
39
|
onOpenChange?: (open: boolean) => void;
|
|
37
40
|
}
|
|
41
|
+
export type AutoUpdateType = (reference: ReferenceElement, floating: FloatingElement, update: () => void) => () => void;
|
|
42
|
+
export type PointerEventType = PointerEvent<HTMLDivElement> | globalThis.PointerEvent;
|
|
43
|
+
export type MouseEventType = MouseEvent<HTMLDivElement> | globalThis.MouseEvent;
|
|
@@ -1,15 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseTooltipAlign, BaseTooltipPlacementType, OffsetType } from './BaseTooltip.types';
|
|
1
|
+
import { ExtendedRefs, Placement, Rect, ReferenceType } from '@floating-ui/react';
|
|
2
|
+
import { BaseTooltipAlign, BaseTooltipPlacementType, MouseEventType, OffsetType, PointerEventType } from './BaseTooltip.types';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
3
4
|
export declare const ARROW_WIDTH = 8;
|
|
4
5
|
export declare const ARROW_HEIGHT = 4;
|
|
5
6
|
export declare const ARROW_PADDING = 6;
|
|
6
7
|
export declare const FLOATING_OFFSET_WITH_ARROW_HEIGHT: number;
|
|
7
8
|
export declare const Max_ZIndex = 2147483647;
|
|
8
9
|
export declare const singleSides: string[];
|
|
9
|
-
export declare const
|
|
10
|
+
export declare const isEmpty: (value: ReactNode | (() => ReactNode)) => boolean;
|
|
11
|
+
export declare const getArrowPlacementCorrection: (placement: Placement, refs: ExtendedRefs<ReferenceType>, align?: BaseTooltipAlign) => {};
|
|
10
12
|
export declare const isTopSide: (placement: Placement) => boolean;
|
|
11
13
|
export declare const isBottomSide: (placement: Placement) => boolean;
|
|
12
14
|
export declare const isLeftSide: (placement: Placement) => boolean;
|
|
13
15
|
export declare const isRightSide: (placement: Placement) => boolean;
|
|
14
16
|
export declare const convertBaseTooltipPlacement: (placement: BaseTooltipPlacementType) => Placement;
|
|
15
17
|
export declare const convertOffsetValues: (rect: Rect) => (element: OffsetType, index: number) => number;
|
|
18
|
+
export declare const getChangedProperties: (e: PointerEventType | MouseEventType, placement: Placement) => {
|
|
19
|
+
width: number;
|
|
20
|
+
x: number;
|
|
21
|
+
right: number;
|
|
22
|
+
left: number;
|
|
23
|
+
height?: undefined;
|
|
24
|
+
y?: undefined;
|
|
25
|
+
top?: undefined;
|
|
26
|
+
bottom?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
height: number;
|
|
29
|
+
y: number;
|
|
30
|
+
top: number;
|
|
31
|
+
bottom: number;
|
|
32
|
+
width?: undefined;
|
|
33
|
+
x?: undefined;
|
|
34
|
+
right?: undefined;
|
|
35
|
+
left?: undefined;
|
|
36
|
+
};
|
|
37
|
+
export declare const setNewReferencePosition: (refs: ExtendedRefs<ReferenceType>, pointerEvent: PointerEventType | MouseEventType, placement: Placement, arrowRef: SVGSVGElement | null) => void;
|
|
38
|
+
export declare const setTargetCallbacks: (element: HTMLElement, handlePointerEnter: ((e: PointerEventType) => void) | undefined, handlePointerLeave: (() => void) | undefined, handleFocus: (() => void) | undefined, handleBlur: (() => void) | undefined, handleClick: ((e: MouseEventType) => void) | undefined, handleContextMenu: ((e: MouseEventType) => void) | undefined, handlePointerUp: ((e: MouseEventType) => void) | undefined) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computePosition, flip } from "@floating-ui/react";
|
|
2
|
+
import { isNil, isUndefined, isNumber } from "lodash-es";
|
|
2
3
|
import { FLOATING_OFFSET } from "../../utils/consts.js";
|
|
3
4
|
const ARROW_WIDTH = 8;
|
|
4
5
|
const ARROW_HEIGHT = 4;
|
|
@@ -9,16 +10,20 @@ const singleSides = ["left", "right", "top", "bottom"];
|
|
|
9
10
|
const leftCorrectionValues = ["top", "bottom", "top-start", "bottom-start", "top-end", "bottom-end"];
|
|
10
11
|
const arrowCenterValues = singleSides;
|
|
11
12
|
const arrowStartValues = ["left-start", "right-start", "top-start", "bottom-start"];
|
|
13
|
+
const isStartPosition = (placement) => arrowStartValues.includes(placement);
|
|
14
|
+
const isCentralPosition = (placement) => arrowCenterValues.includes(placement);
|
|
15
|
+
const isLeftCorrection = (placement) => leftCorrectionValues.includes(placement);
|
|
16
|
+
const isEmpty = (value) => isNil(value) || value === "";
|
|
12
17
|
const getArrowPosition = (placement, start, end) => {
|
|
13
|
-
if (
|
|
18
|
+
if (isStartPosition(placement)) {
|
|
14
19
|
return start;
|
|
15
20
|
}
|
|
16
21
|
return end;
|
|
17
22
|
};
|
|
18
|
-
const getArrowPlacementCorrection = (placement,
|
|
23
|
+
const getArrowPlacementCorrection = (placement, refs, align) => {
|
|
19
24
|
var _a, _b, _c, _d, _e, _f;
|
|
20
|
-
const floatingWidth = (_a =
|
|
21
|
-
const floatingHeight = (_b =
|
|
25
|
+
const floatingWidth = (_a = refs.floating.current) == null ? void 0 : _a.offsetWidth;
|
|
26
|
+
const floatingHeight = (_b = refs.floating.current) == null ? void 0 : _b.offsetHeight;
|
|
22
27
|
const isLeftCorrecting = leftCorrectionValues.includes(placement);
|
|
23
28
|
const floatingCorrectingSize = isLeftCorrecting ? floatingWidth : floatingHeight;
|
|
24
29
|
if (isUndefined(floatingCorrectingSize)) {
|
|
@@ -30,8 +35,8 @@ const getArrowPlacementCorrection = (placement, context, align) => {
|
|
|
30
35
|
...wrapperPaddingCompensation
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
|
-
const floatingRect = (_c =
|
|
34
|
-
const targetRect = (_d =
|
|
38
|
+
const floatingRect = (_c = refs.floating.current) == null ? void 0 : _c.getBoundingClientRect();
|
|
39
|
+
const targetRect = (_d = refs.reference.current) == null ? void 0 : _d.getBoundingClientRect();
|
|
35
40
|
const convertedOffsetValues = floatingRect ? (_e = align == null ? void 0 : align.offset) == null ? void 0 : _e.map(convertOffsetValues(floatingRect)) : [0, 0];
|
|
36
41
|
const convertedTargetOffsetValues = targetRect ? (_f = align == null ? void 0 : align.targetOffset) == null ? void 0 : _f.map(convertOffsetValues(targetRect)) : [0, 0];
|
|
37
42
|
const offsetValue = leftCorrectionValues.includes(placement) ? ((convertedOffsetValues == null ? void 0 : convertedOffsetValues[0]) ?? 0) - ((convertedTargetOffsetValues == null ? void 0 : convertedTargetOffsetValues[0]) ?? 0) : ((convertedOffsetValues == null ? void 0 : convertedOffsetValues[1]) ?? 0) - ((convertedTargetOffsetValues == null ? void 0 : convertedTargetOffsetValues[1]) ?? 0);
|
|
@@ -105,6 +110,77 @@ const convertOffsetValues = (rect) => (element, index) => {
|
|
|
105
110
|
const elementSize = index === 0 ? rect.width : rect.height;
|
|
106
111
|
return elementSize / 100 * percentValue;
|
|
107
112
|
};
|
|
113
|
+
const getChangedProperties = (e, placement) => {
|
|
114
|
+
if (isLeftCorrection(placement)) {
|
|
115
|
+
return {
|
|
116
|
+
width: 0,
|
|
117
|
+
x: e.clientX,
|
|
118
|
+
right: e.clientX,
|
|
119
|
+
left: e.clientX
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
height: 0,
|
|
124
|
+
y: e.clientY,
|
|
125
|
+
top: e.clientY,
|
|
126
|
+
bottom: e.clientY
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const correctionOnArrowWidth = (position, placement) => {
|
|
130
|
+
if (isStartPosition(placement)) {
|
|
131
|
+
return position - ARROW_WIDTH;
|
|
132
|
+
}
|
|
133
|
+
if (isCentralPosition(placement)) {
|
|
134
|
+
return position;
|
|
135
|
+
}
|
|
136
|
+
return position + ARROW_WIDTH * 1.5;
|
|
137
|
+
};
|
|
138
|
+
const setNewReferencePosition = (refs, pointerEvent, placement, arrowRef) => {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
const reference = refs.domReference.current;
|
|
141
|
+
const floating = refs.floating.current;
|
|
142
|
+
const rect = (_b = (_a = refs == null ? void 0 : refs.domReference) == null ? void 0 : _a.current) == null ? void 0 : _b.getBoundingClientRect();
|
|
143
|
+
if (rect && reference && floating) {
|
|
144
|
+
const changedProperties = getChangedProperties(pointerEvent, placement);
|
|
145
|
+
const virtualEl = {
|
|
146
|
+
getBoundingClientRect() {
|
|
147
|
+
return {
|
|
148
|
+
...rect,
|
|
149
|
+
...changedProperties
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
contextElement: reference
|
|
153
|
+
};
|
|
154
|
+
computePosition(virtualEl, floating, {
|
|
155
|
+
placement,
|
|
156
|
+
middleware: [flip()]
|
|
157
|
+
}).then(({
|
|
158
|
+
x,
|
|
159
|
+
y,
|
|
160
|
+
placement: placement2
|
|
161
|
+
}) => {
|
|
162
|
+
const correctedX = isLeftCorrection(placement2) ? correctionOnArrowWidth(x, placement2) : x;
|
|
163
|
+
const correctedY = isLeftCorrection(placement2) ? y : correctionOnArrowWidth(y, placement2);
|
|
164
|
+
Object.assign(floating.style, {
|
|
165
|
+
left: `${correctedX}px`,
|
|
166
|
+
top: `${correctedY}px`
|
|
167
|
+
});
|
|
168
|
+
if (arrowRef) {
|
|
169
|
+
const arrowPlacementCorrection = getArrowPlacementCorrection(placement2, refs);
|
|
170
|
+
Object.assign(arrowRef.style, arrowPlacementCorrection);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const setTargetCallbacks = (element, handlePointerEnter, handlePointerLeave, handleFocus, handleBlur, handleClick, handleContextMenu, handlePointerUp) => {
|
|
176
|
+
element.onpointerenter = handlePointerEnter ?? (element == null ? void 0 : element.onpointerenter);
|
|
177
|
+
element.onpointerleave = handlePointerLeave ?? (element == null ? void 0 : element.onpointerleave);
|
|
178
|
+
element.onfocus = handleFocus ?? (element == null ? void 0 : element.onfocus);
|
|
179
|
+
element.onblur = handleBlur ?? (element == null ? void 0 : element.onblur);
|
|
180
|
+
element.onclick = handleClick ?? (element == null ? void 0 : element.onclick);
|
|
181
|
+
element.oncontextmenu = handleContextMenu ?? (element == null ? void 0 : element.oncontextmenu);
|
|
182
|
+
element.onpointerup = handlePointerUp ?? (element == null ? void 0 : element.onpointerup);
|
|
183
|
+
};
|
|
108
184
|
export {
|
|
109
185
|
ARROW_HEIGHT,
|
|
110
186
|
ARROW_PADDING,
|
|
@@ -114,9 +190,13 @@ export {
|
|
|
114
190
|
convertBaseTooltipPlacement,
|
|
115
191
|
convertOffsetValues,
|
|
116
192
|
getArrowPlacementCorrection,
|
|
193
|
+
getChangedProperties,
|
|
117
194
|
isBottomSide,
|
|
195
|
+
isEmpty,
|
|
118
196
|
isLeftSide,
|
|
119
197
|
isRightSide,
|
|
120
198
|
isTopSide,
|
|
199
|
+
setNewReferencePosition,
|
|
200
|
+
setTargetCallbacks,
|
|
121
201
|
singleSides
|
|
122
202
|
};
|
|
@@ -12,7 +12,7 @@ export declare const useCustomFloating: ({ placement, autoAdjustOverflow, withAr
|
|
|
12
12
|
floating: React.MutableRefObject<HTMLElement | null>;
|
|
13
13
|
setReference: (node: import('@floating-ui/react-dom').ReferenceType | null) => void;
|
|
14
14
|
setFloating: (node: HTMLElement | null) => void;
|
|
15
|
-
} & import('@floating-ui/react').ExtendedRefs<
|
|
15
|
+
} & import('@floating-ui/react').ExtendedRefs<HTMLElement>;
|
|
16
16
|
floatingStyles: import('react').CSSProperties;
|
|
17
17
|
context: {
|
|
18
18
|
x: number;
|
|
@@ -29,10 +29,11 @@ export declare const useCustomFloating: ({ placement, autoAdjustOverflow, withAr
|
|
|
29
29
|
dataRef: React.MutableRefObject<import('@floating-ui/react').ContextData>;
|
|
30
30
|
nodeId: string | undefined;
|
|
31
31
|
floatingId: string | undefined;
|
|
32
|
-
refs: import('@floating-ui/react').ExtendedRefs<
|
|
33
|
-
elements: import('@floating-ui/react').ExtendedElements<
|
|
32
|
+
refs: import('@floating-ui/react').ExtendedRefs<HTMLElement>;
|
|
33
|
+
elements: import('@floating-ui/react').ExtendedElements<HTMLElement>;
|
|
34
34
|
};
|
|
35
35
|
floatingPlacement: import('@floating-ui/utils').Placement;
|
|
36
36
|
setArrowRef: import('react').Dispatch<import('react').SetStateAction<SVGSVGElement | null>>;
|
|
37
|
+
arrowRef: SVGSVGElement | null;
|
|
37
38
|
};
|
|
38
39
|
export {};
|
|
@@ -20,36 +20,34 @@ const useCustomFloating = ({
|
|
|
20
20
|
const adjustY = ((_b2 = align == null ? void 0 : align.overflow) == null ? void 0 : _b2.adjustY) ?? autoAdjustOverflow;
|
|
21
21
|
const withFlip = adjustX || adjustY;
|
|
22
22
|
if (withFlip) {
|
|
23
|
-
floatingMiddleware[
|
|
23
|
+
floatingMiddleware[1] = flip({
|
|
24
24
|
mainAxis: isXMainAxis ? adjustX : adjustY,
|
|
25
25
|
crossAxis: isXMainAxis ? adjustY : adjustX
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
}, [
|
|
28
|
+
}, [(_a = align == null ? void 0 : align.overflow) == null ? void 0 : _a.adjustX, (_b = align == null ? void 0 : align.overflow) == null ? void 0 : _b.adjustY, autoAdjustOverflow, isXMainAxis]);
|
|
29
29
|
useEffect(() => {
|
|
30
|
-
floatingMiddleware[
|
|
30
|
+
floatingMiddleware[2] = shift({
|
|
31
31
|
mainAxis: singleSides.includes(convertedPlacement)
|
|
32
32
|
});
|
|
33
33
|
}, [convertedPlacement]);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
floatingMiddleware[2] = offsetResult;
|
|
52
|
-
}, [align == null ? void 0 : align.offset, align == null ? void 0 : align.targetOffset, convertedPlacement, isXMainAxis]);
|
|
34
|
+
const offsetResult = offset(({
|
|
35
|
+
rects
|
|
36
|
+
}) => {
|
|
37
|
+
var _a2, _b2;
|
|
38
|
+
if (isUndefined(align == null ? void 0 : align.offset) && isUndefined(align == null ? void 0 : align.targetOffset)) {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
const convertedOffsetValues = (_a2 = align == null ? void 0 : align.offset) == null ? void 0 : _a2.map(convertOffsetValues(rects.floating));
|
|
42
|
+
const convertedTargetOffsetValues = (_b2 = align == null ? void 0 : align.targetOffset) == null ? void 0 : _b2.map(convertOffsetValues(rects.reference));
|
|
43
|
+
const mainAxis = isXMainAxis ? ((convertedOffsetValues == null ? void 0 : convertedOffsetValues[0]) ?? 0) - ((convertedTargetOffsetValues == null ? void 0 : convertedTargetOffsetValues[0]) ?? 0) : ((convertedOffsetValues == null ? void 0 : convertedOffsetValues[1]) ?? 0) - ((convertedTargetOffsetValues == null ? void 0 : convertedTargetOffsetValues[1]) ?? 0);
|
|
44
|
+
const crossAxis = isXMainAxis ? ((convertedOffsetValues == null ? void 0 : convertedOffsetValues[1]) ?? 0) - ((convertedTargetOffsetValues == null ? void 0 : convertedTargetOffsetValues[1]) ?? 0) : ((convertedOffsetValues == null ? void 0 : convertedOffsetValues[0]) ?? 0) - ((convertedTargetOffsetValues == null ? void 0 : convertedTargetOffsetValues[0]) ?? 0);
|
|
45
|
+
return {
|
|
46
|
+
mainAxis,
|
|
47
|
+
crossAxis
|
|
48
|
+
};
|
|
49
|
+
}, [convertedPlacement]);
|
|
50
|
+
floatingMiddleware[0] = offsetResult;
|
|
53
51
|
useEffect(() => {
|
|
54
52
|
if (arrowRef && withArrow) {
|
|
55
53
|
floatingMiddleware[3] = arrow({
|
|
@@ -74,7 +72,8 @@ const useCustomFloating = ({
|
|
|
74
72
|
floatingStyles,
|
|
75
73
|
context,
|
|
76
74
|
floatingPlacement,
|
|
77
|
-
setArrowRef
|
|
75
|
+
setArrowRef,
|
|
76
|
+
arrowRef
|
|
78
77
|
};
|
|
79
78
|
};
|
|
80
79
|
export {
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ExtendedRefs, ReferenceType } from '@floating-ui/react';
|
|
1
|
+
import { BaseTooltipTriggerType, MouseEventType, PointerEventType } from '../BaseTooltip.types';
|
|
2
|
+
import { ExtendedRefs, ReferenceType, Placement } from '@floating-ui/react';
|
|
4
3
|
export interface UseShowTooltipControllerProp {
|
|
5
4
|
trigger: BaseTooltipTriggerType[];
|
|
6
5
|
defaultOpen: boolean;
|
|
7
6
|
open: boolean | undefined;
|
|
8
7
|
mouseEnterDelay: number;
|
|
9
8
|
mouseLeaveDelay: number;
|
|
9
|
+
showInCursorPosition: boolean;
|
|
10
|
+
placement: Placement;
|
|
10
11
|
refs: ExtendedRefs<ReferenceType>;
|
|
11
12
|
onOpenChange: ((open: boolean) => void) | undefined;
|
|
13
|
+
arrowRef: SVGSVGElement | null;
|
|
12
14
|
}
|
|
13
|
-
export declare const useShowTooltipController: ({ trigger, defaultOpen, open, mouseEnterDelay, mouseLeaveDelay, refs, onOpenChange, }: UseShowTooltipControllerProp) => {
|
|
15
|
+
export declare const useShowTooltipController: ({ trigger, defaultOpen, open, mouseEnterDelay, mouseLeaveDelay, showInCursorPosition, refs, placement, onOpenChange, arrowRef, }: UseShowTooltipControllerProp) => {
|
|
14
16
|
isOpen: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
handlePointerEnter: ((e: PointerEventType) => void) | undefined;
|
|
18
|
+
handlePointerLeave: (() => void) | undefined;
|
|
17
19
|
handleFocus: (() => void) | undefined;
|
|
18
20
|
handleBlur: (() => void) | undefined;
|
|
19
|
-
handleClick: ((e:
|
|
20
|
-
handleContextMenu: ((e:
|
|
21
|
-
|
|
21
|
+
handleClick: ((e: MouseEventType) => void) | undefined;
|
|
22
|
+
handleContextMenu: ((e: MouseEventType) => void) | undefined;
|
|
23
|
+
handlePointerUp: ((e: MouseEventType) => void) | undefined;
|
|
22
24
|
};
|