react-tooltip 4.4.5 → 4.5.0

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/index.js CHANGED
@@ -2515,11 +2515,15 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
2515
2515
  value: function componentDidMount() {
2516
2516
  var _this$props = this.props;
2517
2517
  _this$props.insecure;
2518
- var resizeHide = _this$props.resizeHide;
2518
+ var resizeHide = _this$props.resizeHide,
2519
+ disableInternalStyle = _this$props.disableInternalStyle;
2519
2520
  this.mount = true;
2520
2521
  this.bindListener(); // Bind listener for tooltip
2521
2522
  this.bindWindowEvents(resizeHide); // Bind global event for static method
2522
- this.injectStyles(); // Inject styles for each DOM root having tooltip.
2523
+
2524
+ if (!disableInternalStyle) {
2525
+ this.injectStyles(); // Inject styles for each DOM root having tooltip.
2526
+ }
2523
2527
  }
2524
2528
  }, {
2525
2529
  key: "componentWillUnmount",
@@ -3072,7 +3076,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
3072
3076
  uuid = _this$state3.uuid;
3073
3077
  var content = this.getTooltipContent();
3074
3078
  var isEmptyTip = this.isEmptyTip(content);
3075
- var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding, this.state.customRadius);
3079
+ var style = this.props.disableInternalStyle ? '' : generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding, this.state.customRadius);
3076
3080
  var tooltipClass = '__react_component_tooltip' + " ".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? ' ' + this.state.borderClass : '') + " place-".concat(this.state.place) + // top, bottom, left, right
3077
3081
  " type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
3078
3082
  // dark, success, warning, error, info, light, custom
@@ -3083,7 +3087,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
3083
3087
  }
3084
3088
  var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');
3085
3089
  if (html) {
3086
- var htmlContent = "".concat(content, "\n<style aria-hidden=\"true\">").concat(style, "</style>");
3090
+ var htmlContent = "".concat(content).concat(style ? "\n<style aria-hidden=\"true\">".concat(style, "</style>") : '');
3087
3091
  return /*#__PURE__*/React__default["default"].createElement(Wrapper, _extends({
3088
3092
  className: "".concat(wrapperClassName),
3089
3093
  id: this.props.id || uuid,
@@ -3105,7 +3109,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
3105
3109
  return _this9.tooltipRef = _ref2;
3106
3110
  },
3107
3111
  "data-id": "tooltip"
3108
- }), /*#__PURE__*/React__default["default"].createElement("style", {
3112
+ }), style && /*#__PURE__*/React__default["default"].createElement("style", {
3109
3113
  dangerouslySetInnerHTML: {
3110
3114
  __html: style
3111
3115
  },
@@ -3156,7 +3160,8 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
3156
3160
  bodyMode: PropTypes__default["default"].bool,
3157
3161
  possibleCustomEvents: PropTypes__default["default"].string,
3158
3162
  possibleCustomEventsOff: PropTypes__default["default"].string,
3159
- clickable: PropTypes__default["default"].bool
3163
+ clickable: PropTypes__default["default"].bool,
3164
+ disableInternalStyle: PropTypes__default["default"].bool
3160
3165
  };
3161
3166
  }
3162
3167
  }, {