@c8y/ngx-components 1023.14.175 → 1023.14.176
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/fesm2022/c8y-ngx-components.mjs +32 -12
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -31131,6 +31131,7 @@ class WidgetsDashboardComponent {
|
|
|
31131
31131
|
this.onCancelDashboard = new EventEmitter();
|
|
31132
31132
|
this.revertChange = new EventEmitter();
|
|
31133
31133
|
this.widgetInFullscreenMode = false;
|
|
31134
|
+
this.widgetFullscreenChangeListener = null;
|
|
31134
31135
|
this.inFullScreen$ = fromEvent(document, 'fullscreenchange').pipe(map(() => this.fullScreen()), startWith(this.fullScreen()));
|
|
31135
31136
|
this.editMode$ = new BehaviorSubject(false);
|
|
31136
31137
|
this.copyDashboardLabel = gettext$1('Copy dashboard');
|
|
@@ -31167,7 +31168,6 @@ class WidgetsDashboardComponent {
|
|
|
31167
31168
|
}
|
|
31168
31169
|
toggleFullscreen(hasWidget = false) {
|
|
31169
31170
|
const elem = document.body;
|
|
31170
|
-
const doc = document;
|
|
31171
31171
|
if (hasWidget) {
|
|
31172
31172
|
elem.classList.add('singleWidget');
|
|
31173
31173
|
this.widgetInFullscreenMode = true;
|
|
@@ -31190,17 +31190,8 @@ class WidgetsDashboardComponent {
|
|
|
31190
31190
|
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
|
|
31191
31191
|
}
|
|
31192
31192
|
}
|
|
31193
|
-
else
|
|
31194
|
-
|
|
31195
|
-
}
|
|
31196
|
-
else if (doc.msExitFullscreen) {
|
|
31197
|
-
doc.msExitFullscreen();
|
|
31198
|
-
}
|
|
31199
|
-
else if (doc.mozCancelFullScreen) {
|
|
31200
|
-
doc.mozCancelFullScreen();
|
|
31201
|
-
}
|
|
31202
|
-
else if (doc.webkitExitFullscreen) {
|
|
31203
|
-
doc.webkitExitFullscreen();
|
|
31193
|
+
else {
|
|
31194
|
+
this.exitFullScreen();
|
|
31204
31195
|
}
|
|
31205
31196
|
}
|
|
31206
31197
|
fullScreen() {
|
|
@@ -31217,16 +31208,30 @@ class WidgetsDashboardComponent {
|
|
|
31217
31208
|
child.fullscreen = !!document.fullscreenElement;
|
|
31218
31209
|
if (!child.fullscreen) {
|
|
31219
31210
|
document.removeEventListener('fullscreenchange', onFullScreen);
|
|
31211
|
+
this.widgetFullscreenChangeListener = null;
|
|
31220
31212
|
document.body.classList.remove('singleWidget');
|
|
31221
31213
|
// required in case fullscreen is exited by e.g. pressing ESC
|
|
31222
31214
|
this.onResize.next();
|
|
31223
31215
|
}
|
|
31224
31216
|
};
|
|
31217
|
+
this.widgetFullscreenChangeListener = onFullScreen;
|
|
31225
31218
|
document.addEventListener('fullscreenchange', onFullScreen);
|
|
31226
31219
|
}
|
|
31227
31220
|
this.toggleFullscreen(child.fullscreen);
|
|
31228
31221
|
this.onResize.next();
|
|
31229
31222
|
}
|
|
31223
|
+
ngOnDestroy() {
|
|
31224
|
+
if (this.widgetInFullscreenMode) {
|
|
31225
|
+
document.body.classList.remove('singleWidget');
|
|
31226
|
+
if (this.widgetFullscreenChangeListener) {
|
|
31227
|
+
document.removeEventListener('fullscreenchange', this.widgetFullscreenChangeListener);
|
|
31228
|
+
this.widgetFullscreenChangeListener = null;
|
|
31229
|
+
}
|
|
31230
|
+
}
|
|
31231
|
+
if (this.fullScreen()) {
|
|
31232
|
+
this.exitFullScreen();
|
|
31233
|
+
}
|
|
31234
|
+
}
|
|
31230
31235
|
updateWidgetClasses(widget, classes) {
|
|
31231
31236
|
widget.classes = { ...widget.classes, ...classes };
|
|
31232
31237
|
}
|
|
@@ -31251,6 +31256,21 @@ class WidgetsDashboardComponent {
|
|
|
31251
31256
|
this.editMode$.next(true);
|
|
31252
31257
|
this.contextDashboard.historyDescription = {};
|
|
31253
31258
|
}
|
|
31259
|
+
exitFullScreen() {
|
|
31260
|
+
const doc = document;
|
|
31261
|
+
if (doc.exitFullscreen) {
|
|
31262
|
+
doc.exitFullscreen();
|
|
31263
|
+
}
|
|
31264
|
+
else if (doc.msExitFullscreen) {
|
|
31265
|
+
doc.msExitFullscreen();
|
|
31266
|
+
}
|
|
31267
|
+
else if (doc.mozCancelFullScreen) {
|
|
31268
|
+
doc.mozCancelFullScreen();
|
|
31269
|
+
}
|
|
31270
|
+
else if (doc.webkitExitFullscreen) {
|
|
31271
|
+
doc.webkitExitFullscreen();
|
|
31272
|
+
}
|
|
31273
|
+
}
|
|
31254
31274
|
setCopyDisabledPopoverMsg() {
|
|
31255
31275
|
if (typeof this.isCopyDisabled === 'boolean' || this.isCopyDisabled?.state) {
|
|
31256
31276
|
return;
|