foris 5.6.1-beta.39257567 → 5.6.1-beta.3fa5ab7c
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/foris-5.6.1.tgz +0 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/hooks.js +1 -21
package/foris-5.6.1.tgz
CHANGED
|
Binary file
|
package/index.js
CHANGED
|
@@ -69,7 +69,7 @@ export {
|
|
|
69
69
|
withErrorMessage,
|
|
70
70
|
} from "./utils/conditionalHOCs";
|
|
71
71
|
export { ErrorMessage } from "./utils/ErrorMessage";
|
|
72
|
-
export { useClickOutside
|
|
72
|
+
export { useClickOutside } from "./utils/hooks";
|
|
73
73
|
export { toLocaleDateString } from "./utils/datetime";
|
|
74
74
|
export { displayCard } from "./utils/displayCard";
|
|
75
75
|
export { isPluginInstalled } from "./utils/isPluginInstalled";
|
package/package.json
CHANGED
package/utils/hooks.js
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* See /LICENSE for more information.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { useState, useEffect
|
|
9
|
-
import { Tooltip } from "bootstrap/dist/js/bootstrap.bundle.min";
|
|
8
|
+
import { useState, useEffect } from "react";
|
|
10
9
|
|
|
11
10
|
/** Execute callback when condition is set to true. */
|
|
12
11
|
export function useConditionalTimeout(
|
|
@@ -41,22 +40,3 @@ export function useClickOutside(element, callback) {
|
|
|
41
40
|
};
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
/** useTooltip hook for Bootstrap tooltips. */
|
|
46
|
-
export function useTooltip(description, placement = "top", trigger = "hover") {
|
|
47
|
-
const tooltipRef = useRef();
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
const tooltip = new Tooltip(tooltipRef.current, {
|
|
51
|
-
title: description,
|
|
52
|
-
placement,
|
|
53
|
-
trigger,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return () => {
|
|
57
|
-
tooltip.dispose();
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return tooltipRef;
|
|
62
|
-
}
|