dce-reactkit 5.0.7 → 5.0.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/cjs/index.js +19 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/helpers/visitServerEndpoint.d.ts +5 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/helpers/visitServerEndpoint.d.ts +5 -0
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/Tooltip.tsx +17 -0
- package/src/helpers/visitServerEndpoint.tsx +5 -0
|
@@ -22,6 +22,8 @@ export declare const _setStubResponse: (opts: {
|
|
|
22
22
|
* @param opts.path - the path of the server endpoint
|
|
23
23
|
* @param [opts.method=GET] - the method of the endpoint
|
|
24
24
|
* @param [opts.params] - query/body parameters to include
|
|
25
|
+
* @param [opts.headers] - custom headers to include; values must already be
|
|
26
|
+
* string to avoid issue with header serialization
|
|
25
27
|
* @returns response from server
|
|
26
28
|
*/
|
|
27
29
|
declare const visitServerEndpoint: (opts: {
|
|
@@ -30,5 +32,8 @@ declare const visitServerEndpoint: (opts: {
|
|
|
30
32
|
params?: {
|
|
31
33
|
[x: string]: any;
|
|
32
34
|
} | undefined;
|
|
35
|
+
headers?: {
|
|
36
|
+
[x: string]: string;
|
|
37
|
+
} | undefined;
|
|
33
38
|
}) => Promise<any>;
|
|
34
39
|
export default visitServerEndpoint;
|
package/dist/esm/index.js
CHANGED
|
@@ -800,6 +800,8 @@ const _setStubResponse = (opts) => {
|
|
|
800
800
|
* @param opts.path - the path of the server endpoint
|
|
801
801
|
* @param [opts.method=GET] - the method of the endpoint
|
|
802
802
|
* @param [opts.params] - query/body parameters to include
|
|
803
|
+
* @param [opts.headers] - custom headers to include; values must already be
|
|
804
|
+
* string to avoid issue with header serialization
|
|
803
805
|
* @returns response from server
|
|
804
806
|
*/
|
|
805
807
|
const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -849,6 +851,7 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function
|
|
|
849
851
|
path: opts.path,
|
|
850
852
|
method: (_c = opts.method) !== null && _c !== void 0 ? _c : 'GET',
|
|
851
853
|
params,
|
|
854
|
+
headers: opts.headers,
|
|
852
855
|
});
|
|
853
856
|
// Check for failure
|
|
854
857
|
if (!response || !response.body) {
|
|
@@ -2677,6 +2680,13 @@ const Tooltip = (props) => {
|
|
|
2677
2680
|
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
2678
2681
|
// Import bootstrap tooltip
|
|
2679
2682
|
const BSTooltip = (yield import('bootstrap')).Tooltip;
|
|
2683
|
+
// The child may have unmounted while the dynamic import above was
|
|
2684
|
+
// resolving (React nulls the ref on unmount). Constructing a
|
|
2685
|
+
// Bootstrap tooltip with a null element causes an error,
|
|
2686
|
+
// so bail out instead
|
|
2687
|
+
if (!childRef.current) {
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2680
2690
|
// Initialize
|
|
2681
2691
|
t = new BSTooltip(childRef.current, {
|
|
2682
2692
|
title: text,
|
|
@@ -2688,6 +2698,15 @@ const Tooltip = (props) => {
|
|
|
2688
2698
|
return () => {
|
|
2689
2699
|
if (t) {
|
|
2690
2700
|
t.dispose();
|
|
2701
|
+
// Bootstrap's hide() queues a transition-end callback that can
|
|
2702
|
+
// fire AFTER dispose and touch the (now null) trigger map and
|
|
2703
|
+
// element (twbs/bootstrap issue #37474). Point those private
|
|
2704
|
+
// fields at harmless stand-ins so the late callback is a no-op
|
|
2705
|
+
// instead of a crash.
|
|
2706
|
+
/* eslint-disable no-underscore-dangle */
|
|
2707
|
+
t._activeTrigger = {};
|
|
2708
|
+
t._element = document.createElement('noscript');
|
|
2709
|
+
/* eslint-enable no-underscore-dangle */
|
|
2691
2710
|
}
|
|
2692
2711
|
};
|
|
2693
2712
|
}, [text]);
|