iobroker.mywebui 1.37.47 → 1.37.48
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/io-package.json
CHANGED
package/package.json
CHANGED
|
@@ -345,6 +345,26 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
345
345
|
fragment.appendChild(n);
|
|
346
346
|
this._rootShadow.appendChild(fragment);
|
|
347
347
|
}
|
|
348
|
+
// Group visibility SSR: remove/disable elements BEFORE applyAllBindings
|
|
349
|
+
// so bindings are never initialized for hidden elements
|
|
350
|
+
const _groupEls = [...this._rootShadow.querySelectorAll('[data-visibility-groups]')];
|
|
351
|
+
for (const el of _groupEls) {
|
|
352
|
+
const groups = el.getAttribute('data-visibility-groups')?.split(',').filter(g => g) || [];
|
|
353
|
+
const action = el.getAttribute('data-visibility-action') || 'hide';
|
|
354
|
+
if (groups.length > 0) {
|
|
355
|
+
try {
|
|
356
|
+
const result = await iobrokerHandler.checkVisibility({ enabled: true, groups, action });
|
|
357
|
+
if (action === 'disable' && !result.enabled) {
|
|
358
|
+
el.style.pointerEvents = 'none';
|
|
359
|
+
el.style.opacity = '0.5';
|
|
360
|
+
} else if (action !== 'disable' && !result.visible) {
|
|
361
|
+
el.remove();
|
|
362
|
+
}
|
|
363
|
+
} catch (err) {
|
|
364
|
+
console.error('[ScreenViewer] Group visibility check error:', err);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
348
368
|
// Custom bind-prop:disable handler — sets pointer-events+opacity when value is truthy
|
|
349
369
|
for (const el of this._rootShadow.querySelectorAll('[bind-prop\\:disable]')) {
|
|
350
370
|
Object.defineProperty(el, 'disable', {
|
|
@@ -386,8 +406,7 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
386
406
|
}
|
|
387
407
|
}
|
|
388
408
|
|
|
389
|
-
//
|
|
390
|
-
await visibilityService.scanAndApply(this._rootShadow);
|
|
409
|
+
// Group visibility is now handled before applyAllBindings (SSR-style, above)
|
|
391
410
|
}
|
|
392
411
|
_stretchView(settings) {
|
|
393
412
|
const stretch = this.stretch ?? settings?.stretch;
|