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 CHANGED
@@ -826,6 +826,8 @@ const _setStubResponse = (opts) => {
826
826
  * @param opts.path - the path of the server endpoint
827
827
  * @param [opts.method=GET] - the method of the endpoint
828
828
  * @param [opts.params] - query/body parameters to include
829
+ * @param [opts.headers] - custom headers to include; values must already be
830
+ * string to avoid issue with header serialization
829
831
  * @returns response from server
830
832
  */
831
833
  const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function* () {
@@ -875,6 +877,7 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function
875
877
  path: opts.path,
876
878
  method: (_c = opts.method) !== null && _c !== void 0 ? _c : 'GET',
877
879
  params,
880
+ headers: opts.headers,
878
881
  });
879
882
  // Check for failure
880
883
  if (!response || !response.body) {
@@ -2703,6 +2706,13 @@ const Tooltip = (props) => {
2703
2706
  (() => __awaiter(void 0, void 0, void 0, function* () {
2704
2707
  // Import bootstrap tooltip
2705
2708
  const BSTooltip = (yield Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('bootstrap')); })).Tooltip;
2709
+ // The child may have unmounted while the dynamic import above was
2710
+ // resolving (React nulls the ref on unmount). Constructing a
2711
+ // Bootstrap tooltip with a null element causes an error,
2712
+ // so bail out instead
2713
+ if (!childRef.current) {
2714
+ return;
2715
+ }
2706
2716
  // Initialize
2707
2717
  t = new BSTooltip(childRef.current, {
2708
2718
  title: text,
@@ -2714,6 +2724,15 @@ const Tooltip = (props) => {
2714
2724
  return () => {
2715
2725
  if (t) {
2716
2726
  t.dispose();
2727
+ // Bootstrap's hide() queues a transition-end callback that can
2728
+ // fire AFTER dispose and touch the (now null) trigger map and
2729
+ // element (twbs/bootstrap issue #37474). Point those private
2730
+ // fields at harmless stand-ins so the late callback is a no-op
2731
+ // instead of a crash.
2732
+ /* eslint-disable no-underscore-dangle */
2733
+ t._activeTrigger = {};
2734
+ t._element = document.createElement('noscript');
2735
+ /* eslint-enable no-underscore-dangle */
2717
2736
  }
2718
2737
  };
2719
2738
  }, [text]);