@ts-core/angular 13.1.27 → 13.1.30

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.
@@ -14,7 +14,6 @@ import { CommonModule, isPlatformServer, isPlatformBrowser, DOCUMENT, DatePipe }
14
14
  import * as i5 from '@angular/forms';
15
15
  import { FormsModule, Validators } from '@angular/forms';
16
16
  import * as Cookie from 'ngx-cookie';
17
- import { ResizeSensor } from 'css-element-queries';
18
17
  import * as interact from 'interactjs';
19
18
  import * as i4$2 from '@angular/material/paginator';
20
19
  import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator';
@@ -509,6 +508,15 @@ class ViewUtil {
509
508
  static getStageHeight() {
510
509
  return ViewUtil.window.innerHeight || ViewUtil.document.body.clientHeight;
511
510
  }
511
+ static getCanvasContext2d(container, options) {
512
+ let canvas = ViewUtil.parseElement(container);
513
+ try {
514
+ return canvas.getContext('2d', options);
515
+ }
516
+ catch (error) {
517
+ return null;
518
+ }
519
+ }
512
520
  static getBoundingRectangle(container) {
513
521
  container = ViewUtil.parseElement(container);
514
522
  if (_.isNil(container) || _.isNil(container.getBoundingClientRect)) {
@@ -1931,6 +1939,7 @@ class CanDeactivateGuard {
1931
1939
  }
1932
1940
 
1933
1941
  class ResizeManager {
1942
+ // protected sensor: ResizeSensor;
1934
1943
  // --------------------------------------------------------------------------
1935
1944
  //
1936
1945
  // Constructor
@@ -1952,9 +1961,20 @@ class ResizeManager {
1952
1961
  this.size = item;
1953
1962
  this.subject.next(item);
1954
1963
  };
1964
+ this.handler2 = (items) => {
1965
+ if (!_.isEmpty(items)) {
1966
+ this.handler(items[0].contentRect);
1967
+ }
1968
+ };
1955
1969
  this.element = ViewUtil.parseElement(element);
1956
1970
  this.subject = new BehaviorSubject({ width: ViewUtil.getWidth(this.element), height: ViewUtil.getHeight(this.element) });
1957
- this.sensor = new ResizeSensor(this.element, this.handler);
1971
+ // this.sensor = new ResizeSensor(this.element, this.handler);
1972
+ // Could be undefined in ssr
1973
+ try {
1974
+ this.sensor = new ResizeObserver(this.handler2);
1975
+ this.sensor.observe(this.element);
1976
+ }
1977
+ catch (error) { }
1958
1978
  }
1959
1979
  // --------------------------------------------------------------------------
1960
1980
  //
@@ -1985,12 +2005,16 @@ class ResizeManager {
1985
2005
  // --------------------------------------------------------------------------
1986
2006
  destroy() {
1987
2007
  if (!_.isNil(this.sensor)) {
2008
+ this.sensor.unobserve(this.element);
2009
+ this.sensor.disconnect();
2010
+ this.sensor = null;
2011
+ /*
1988
2012
  this.sensor.detach(this.handler);
1989
2013
  try {
1990
2014
  this.sensor.reset();
1991
- }
1992
- catch (error) { }
2015
+ } catch (error) {}
1993
2016
  this.sensor = null;
2017
+ */
1994
2018
  }
1995
2019
  if (!_.isNil(this.subject)) {
1996
2020
  this.subject.complete();