iobroker.mywebui 1.37.46 → 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
|
@@ -486,9 +486,11 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
486
486
|
designItem.setAttribute('bind-prop:hidden', JSON.stringify(bnd));
|
|
487
487
|
designItem.removeAttribute('bind-prop:disable');
|
|
488
488
|
}
|
|
489
|
+
designItem.setAttribute('data-visibility-action', action);
|
|
489
490
|
} else {
|
|
490
491
|
designItem.removeAttribute('bind-prop:hidden');
|
|
491
492
|
designItem.removeAttribute('bind-prop:disable');
|
|
493
|
+
designItem.removeAttribute('data-visibility-action');
|
|
492
494
|
}
|
|
493
495
|
designItem.removeAttribute('data-visibility-signal');
|
|
494
496
|
this._updateVisibilityPanel();
|
|
@@ -585,7 +587,10 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
585
587
|
const enableCheck = document.createElement('input');
|
|
586
588
|
enableCheck.type = 'checkbox';
|
|
587
589
|
enableCheck.checked = dataConfig.enabled || false;
|
|
588
|
-
enableCheck.onchange = () =>
|
|
590
|
+
enableCheck.onchange = () => {
|
|
591
|
+
updateGroupConfig('enabled', enableCheck.checked);
|
|
592
|
+
if (enableCheck.checked) updateGroupConfig('action', actionSelect.value);
|
|
593
|
+
};
|
|
589
594
|
enableLabel.appendChild(enableCheck);
|
|
590
595
|
enableLabel.appendChild(document.createTextNode('Enable Group Visibility Control'));
|
|
591
596
|
enableDiv.appendChild(enableLabel);
|
|
@@ -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;
|