@datarailsshared/datarailsshared 1.3.39 → 1.3.40

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.
@@ -3182,12 +3182,16 @@
3182
3182
  }
3183
3183
  else {
3184
3184
  var defaultChildPadding = 3;
3185
- var widthMoreWindowRight = window.innerWidth - this.position.clientX - this.el.nativeElement.offsetWidth - defaultPadding;
3186
- var widthMoreWindowBottom = window.innerHeight - this.position.clientY - this.el.nativeElement.offsetHeight - defaultPadding;
3185
+ var widthMoreWindowRight = window.innerWidth - (this.position.clientX - this.el.nativeElement.offsetWidth - defaultPadding);
3186
+ var widthMoreWindowBottom = window.innerHeight - (this.position.clientY - this.el.nativeElement.offsetHeight - defaultPadding);
3187
+ var spaceRightAmount = window.innerWidth - (this.position.clientX + this.el.nativeElement.offsetWidth + defaultPadding);
3187
3188
  this.widthMoreRight = !(widthMoreWindowRight < 0);
3188
3189
  var calculatedHorizantallyPos = widthMoreWindowRight < 0
3189
3190
  ? -this.position.x + -defaultChildPadding
3190
3191
  : this.position.x + defaultChildPadding + xDifference;
3192
+ if (spaceRightAmount <= 0) {
3193
+ calculatedHorizantallyPos -= this.el.nativeElement.offsetWidth;
3194
+ }
3191
3195
  var deltaHeight = widthMoreWindowBottom < 0 ? widthMoreWindowBottom : defaultDelta;
3192
3196
  this.renderer.setStyle(this.el.nativeElement, 'top', (this.position.y + deltaHeight) + 'px');
3193
3197
  this.renderer.setStyle(this.el.nativeElement, 'left', (calculatedHorizantallyPos) + 'px');