dce-reactkit 3.7.1-beta.2 → 3.7.2-beta.1
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/cjs/index.js +15 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +15 -7
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Tooltip.tsx +20 -12
package/package.json
CHANGED
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
// Import React
|
|
7
7
|
import React, { useEffect, useRef } from 'react';
|
|
8
8
|
|
|
9
|
-
// Import Bootstrap
|
|
10
|
-
import { Tooltip as BSTooltip } from 'bootstrap';
|
|
11
|
-
|
|
12
9
|
/*------------------------------------------------------------------------*/
|
|
13
10
|
/* -------------------------------- Types ------------------------------- */
|
|
14
11
|
/*------------------------------------------------------------------------*/
|
|
@@ -58,19 +55,30 @@ const Tooltip: React.FC<Props> = (props) => {
|
|
|
58
55
|
return;
|
|
59
56
|
}
|
|
60
57
|
|
|
58
|
+
// Store copy of tooltip
|
|
59
|
+
let t: any;
|
|
60
|
+
|
|
61
61
|
// Initialize tooltip
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
(async () => {
|
|
63
|
+
// Import bootstrap tooltip
|
|
64
|
+
const BSTooltip = (await import('bootstrap')).Tooltip;
|
|
65
|
+
|
|
66
|
+
// Initialize
|
|
67
|
+
t = new BSTooltip(
|
|
68
|
+
childRef.current,
|
|
69
|
+
{
|
|
70
|
+
title: text,
|
|
71
|
+
placement: 'top',
|
|
72
|
+
trigger: 'hover',
|
|
73
|
+
},
|
|
74
|
+
);
|
|
75
|
+
})();
|
|
70
76
|
|
|
71
77
|
// Clean up tooltip
|
|
72
78
|
return () => {
|
|
73
|
-
t
|
|
79
|
+
if (t) {
|
|
80
|
+
t.dispose();
|
|
81
|
+
}
|
|
74
82
|
};
|
|
75
83
|
},
|
|
76
84
|
[text],
|