@skedulo/sked-ui 21.9.2 → 21.9.3

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.
@@ -100,6 +100,7 @@ export declare class LegacyInfoWindow extends React.PureComponent<ILegacyInfoWin
100
100
  private _cursorPosition;
101
101
  private _triggerRect;
102
102
  private _root;
103
+ private _timeoutId;
103
104
  constructor(props: ILegacyInfoWindowProps);
104
105
  componentDidMount(): void;
105
106
  componentDidUpdate(oldProps: ILegacyInfoWindowProps): void;
@@ -145,7 +146,6 @@ export declare class LegacyInfoWindow extends React.PureComponent<ILegacyInfoWin
145
146
  };
146
147
  removeRenderingContainer(): void;
147
148
  createRenderContainer(): HTMLDivElement;
148
- createRenderRoot(): void;
149
149
  /**
150
150
  * The first render wont be positioned properly since we don't have the width/height to calculate the position.
151
151
  * `runStyleRender` runs a second render when we have the contentContainer rendered to calculate the position.
package/dist/index.js CHANGED
@@ -5788,6 +5788,8 @@ var LegacyInfoWindow = /*#__PURE__*/function (_React$PureComponent) {
5788
5788
 
5789
5789
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), "_root", null);
5790
5790
 
5791
+ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), "_timeoutId", null);
5792
+
5791
5793
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), "computeStylesFromDisplayPosition", function (anchor, triangleRect) {
5792
5794
  var contentStyles = {
5793
5795
  top: anchor.display.top,
@@ -6092,12 +6094,6 @@ var LegacyInfoWindow = /*#__PURE__*/function (_React$PureComponent) {
6092
6094
  document.body.appendChild(div);
6093
6095
  return div;
6094
6096
  }
6095
- }, {
6096
- key: "createRenderRoot",
6097
- value: function createRenderRoot() {
6098
- var renderContainer = this._renderContainer || this.createRenderContainer();
6099
- this._root = Object(react_dom_client__WEBPACK_IMPORTED_MODULE_10__["createRoot"])(renderContainer);
6100
- }
6101
6097
  /**
6102
6098
  * The first render wont be positioned properly since we don't have the width/height to calculate the position.
6103
6099
  * `runStyleRender` runs a second render when we have the contentContainer rendered to calculate the position.
@@ -6106,7 +6102,8 @@ var LegacyInfoWindow = /*#__PURE__*/function (_React$PureComponent) {
6106
6102
  }, {
6107
6103
  key: "renderContent",
6108
6104
  value: function renderContent() {
6109
- var _this2 = this;
6105
+ var _this$_root,
6106
+ _this2 = this;
6110
6107
 
6111
6108
  var runStyleRender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
6112
6109
  var show = this.state.show;
@@ -6114,10 +6111,8 @@ var LegacyInfoWindow = /*#__PURE__*/function (_React$PureComponent) {
6114
6111
  withCloseButton = _this$props3.withCloseButton,
6115
6112
  containerClassName = _this$props3.containerClassName;
6116
6113
  var classNames = "sked-infowindow-wrapper ".concat(containerClassName || '');
6117
-
6118
- if (!this._root) {
6119
- this.createRenderRoot();
6120
- }
6114
+ var renderContainer = this._renderContainer || this.createRenderContainer();
6115
+ this._root = (_this$_root = this._root) !== null && _this$_root !== void 0 ? _this$_root : Object(react_dom_client__WEBPACK_IMPORTED_MODULE_10__["createRoot"])(renderContainer);
6121
6116
 
6122
6117
  if (show) {
6123
6118
  var _this$computeStyles = this.computeStyles(),
@@ -6156,10 +6151,14 @@ var LegacyInfoWindow = /*#__PURE__*/function (_React$PureComponent) {
6156
6151
 
6157
6152
  this._root.render(content);
6158
6153
 
6159
- setTimeout(callback, 0);
6154
+ this._timeoutId = setTimeout(callback, 0);
6160
6155
  } else {
6161
6156
  if (this._root) {
6157
+ clearTimeout(this._timeoutId);
6158
+
6162
6159
  this._root.unmount();
6160
+
6161
+ this._root = null;
6163
6162
  }
6164
6163
 
6165
6164
  this.removeRenderingContainer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/sked-ui",
3
- "version": "21.9.2",
3
+ "version": "21.9.3",
4
4
  "license": "UNLICENSED",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",