@onesy/ui-react 1.0.17 → 1.0.18
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/Tooltip/Tooltip.js +6 -5
- package/esm/Tooltip/Tooltip.js +6 -5
- package/esm/index.js +1 -1
- package/package.json +2 -2
package/Tooltip/Tooltip.js
CHANGED
@@ -203,7 +203,7 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
203
203
|
if (refs.longPress.current) {
|
204
204
|
setLongPress(false);
|
205
205
|
if (refs.props.current.open === undefined) {
|
206
|
-
if (!inProp)
|
206
|
+
if (!refs.inProp.current)
|
207
207
|
onClose();
|
208
208
|
else
|
209
209
|
setInProp(false);
|
@@ -236,7 +236,7 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
236
236
|
if (refs.longPress.current) {
|
237
237
|
setLongPress(false);
|
238
238
|
if (refs.props.current.open === undefined) {
|
239
|
-
if (!inProp)
|
239
|
+
if (!refs.inProp.current)
|
240
240
|
onClose();
|
241
241
|
else
|
242
242
|
setInProp(false);
|
@@ -262,7 +262,7 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
262
262
|
const onOpen = () => {
|
263
263
|
if (!open)
|
264
264
|
setOpen(true);
|
265
|
-
if (!inProp)
|
265
|
+
if (!refs.inProp.current)
|
266
266
|
setInProp(true);
|
267
267
|
if ((0, utils_1.is)('function', onOpen_) && !open)
|
268
268
|
onOpen_();
|
@@ -304,7 +304,7 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
304
304
|
if (refs.open.current)
|
305
305
|
onOpen();
|
306
306
|
else {
|
307
|
-
if (!inProp)
|
307
|
+
if (!refs.inProp.current)
|
308
308
|
onClose();
|
309
309
|
else
|
310
310
|
setInProp(false);
|
@@ -317,7 +317,7 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
317
317
|
if (refs.open.current)
|
318
318
|
onOpen();
|
319
319
|
else {
|
320
|
-
if (!inProp)
|
320
|
+
if (!refs.inProp.current)
|
321
321
|
onClose();
|
322
322
|
else
|
323
323
|
setInProp(false);
|
@@ -422,6 +422,7 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
422
422
|
} }, { children: children && (react_1.default.cloneElement(children, Object.assign(Object.assign({ onMouseMove }, (click && {
|
423
423
|
onClick: (event) => {
|
424
424
|
var _a, _b;
|
425
|
+
event.stopPropagation();
|
425
426
|
if ((0, utils_1.is)('function', (_a = children === null || children === void 0 ? void 0 : children.props) === null || _a === void 0 ? void 0 : _a.onClick))
|
426
427
|
(_b = children === null || children === void 0 ? void 0 : children.props) === null || _b === void 0 ? void 0 : _b.onClick(event);
|
427
428
|
onClick(event);
|
package/esm/Tooltip/Tooltip.js
CHANGED
@@ -267,7 +267,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
267
267
|
if (refs.longPress.current) {
|
268
268
|
setLongPress(false);
|
269
269
|
if (refs.props.current.open === undefined) {
|
270
|
-
if (!inProp) onClose();else setInProp(false);
|
270
|
+
if (!refs.inProp.current) onClose();else setInProp(false);
|
271
271
|
}
|
272
272
|
}
|
273
273
|
if (hover_) setHover(false);
|
@@ -289,7 +289,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
289
289
|
if (refs.longPress.current) {
|
290
290
|
setLongPress(false);
|
291
291
|
if (refs.props.current.open === undefined) {
|
292
|
-
if (!inProp) onClose();else setInProp(false);
|
292
|
+
if (!refs.inProp.current) onClose();else setInProp(false);
|
293
293
|
}
|
294
294
|
}
|
295
295
|
if (focus_) setFocus(false);
|
@@ -308,7 +308,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
308
308
|
}, []);
|
309
309
|
const onOpen = () => {
|
310
310
|
if (!open) setOpen(true);
|
311
|
-
if (!inProp) setInProp(true);
|
311
|
+
if (!refs.inProp.current) setInProp(true);
|
312
312
|
if (is('function', onOpen_) && !open) onOpen_();
|
313
313
|
};
|
314
314
|
const onClose = () => {
|
@@ -338,7 +338,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
338
338
|
if (init && refs.props.current.open === undefined) {
|
339
339
|
refs.open.current = touch || hover || longPress;
|
340
340
|
if (refs.open.current) onOpen();else {
|
341
|
-
if (!inProp) onClose();else setInProp(false);
|
341
|
+
if (!refs.inProp.current) onClose();else setInProp(false);
|
342
342
|
}
|
343
343
|
}
|
344
344
|
}, [touch, hover, longPress]);
|
@@ -346,7 +346,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
346
346
|
if (init && refs.props.current.open === undefined) {
|
347
347
|
refs.open.current = focus;
|
348
348
|
if (refs.open.current) onOpen();else {
|
349
|
-
if (!inProp) onClose();else setInProp(false);
|
349
|
+
if (!refs.inProp.current) onClose();else setInProp(false);
|
350
350
|
}
|
351
351
|
}
|
352
352
|
}, [focus]);
|
@@ -435,6 +435,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
435
435
|
onMouseMove
|
436
436
|
}, click && {
|
437
437
|
onClick: event => {
|
438
|
+
event.stopPropagation();
|
438
439
|
if (is('function', children?.props?.onClick)) children?.props?.onClick(event);
|
439
440
|
onClick(event);
|
440
441
|
}
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "@onesy/ui-react",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.18",
|
4
4
|
"description": "UI for React",
|
5
|
-
"repository": "https://github.com/onesy-
|
5
|
+
"repository": "https://github.com/onesy-me/onesy.git",
|
6
6
|
"author": "Lazar <lazareric2@gmail.com>",
|
7
7
|
"license": "MIT",
|
8
8
|
"private": false,
|