@ts-core/angular 13.1.24 → 13.1.27

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.
@@ -509,6 +509,22 @@ class ViewUtil {
509
509
  static getStageHeight() {
510
510
  return ViewUtil.window.innerHeight || ViewUtil.document.body.clientHeight;
511
511
  }
512
+ static getBoundingRectangle(container) {
513
+ container = ViewUtil.parseElement(container);
514
+ if (_.isNil(container) || _.isNil(container.getBoundingClientRect)) {
515
+ return {
516
+ x: NaN,
517
+ y: NaN,
518
+ width: NaN,
519
+ height: NaN,
520
+ top: NaN,
521
+ right: NaN,
522
+ left: NaN,
523
+ bottom: NaN
524
+ };
525
+ }
526
+ return container.getBoundingClientRect();
527
+ }
512
528
  static getWidth(container) {
513
529
  container = ViewUtil.parseElement(container);
514
530
  if (_.isNil(container)) {
@@ -516,7 +532,7 @@ class ViewUtil {
516
532
  }
517
533
  let value = parseFloat(ViewUtil.getStyle(container, 'width'));
518
534
  if (_.isNaN(value)) {
519
- value = container.getBoundingClientRect().width;
535
+ value = ViewUtil.getBoundingRectangle(container).width;
520
536
  }
521
537
  if (_.isNaN(value)) {
522
538
  value = container.offsetWidth;
@@ -561,7 +577,7 @@ class ViewUtil {
561
577
  }
562
578
  let value = parseFloat(ViewUtil.getStyle(container, 'height'));
563
579
  if (_.isNaN(value)) {
564
- value = container.getBoundingClientRect().height;
580
+ value = ViewUtil.getBoundingRectangle(container).height;
565
581
  }
566
582
  if (_.isNaN(value)) {
567
583
  value = container.offsetHeight;