@ts-core/angular 13.1.29 → 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.
- package/esm2020/manager/ResizeManager.mjs +2 -1
- package/esm2020/util/ViewUtil.mjs +10 -1
- package/fesm2015/ts-core-angular.mjs +10 -0
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +10 -0
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/util/ViewUtil.d.ts +2 -1
|
@@ -508,6 +508,15 @@ class ViewUtil {
|
|
|
508
508
|
static getStageHeight() {
|
|
509
509
|
return ViewUtil.window.innerHeight || ViewUtil.document.body.clientHeight;
|
|
510
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
|
+
}
|
|
511
520
|
static getBoundingRectangle(container) {
|
|
512
521
|
container = ViewUtil.parseElement(container);
|
|
513
522
|
if (_.isNil(container) || _.isNil(container.getBoundingClientRect)) {
|
|
@@ -1960,6 +1969,7 @@ class ResizeManager {
|
|
|
1960
1969
|
this.element = ViewUtil.parseElement(element);
|
|
1961
1970
|
this.subject = new BehaviorSubject({ width: ViewUtil.getWidth(this.element), height: ViewUtil.getHeight(this.element) });
|
|
1962
1971
|
// this.sensor = new ResizeSensor(this.element, this.handler);
|
|
1972
|
+
// Could be undefined in ssr
|
|
1963
1973
|
try {
|
|
1964
1974
|
this.sensor = new ResizeObserver(this.handler2);
|
|
1965
1975
|
this.sensor.observe(this.element);
|