iobroker.mywebui 1.37.87 → 1.37.88
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
|
@@ -674,9 +674,11 @@ export class IobrokerWebuiScreenEditor extends BaseCustomWebComponentConstructor
|
|
|
674
674
|
const shadowRoot = rootEl?.shadowRoot;
|
|
675
675
|
if (!rootEl || !shadowRoot) return;
|
|
676
676
|
try {
|
|
677
|
-
// Proxy wraps rootEl so ALL native HTMLElement methods (
|
|
678
|
-
//
|
|
679
|
-
//
|
|
677
|
+
// Proxy wraps rootEl so ALL native HTMLElement methods (querySelector, closest, etc.) work.
|
|
678
|
+
// Custom WebUI API and attachInternals stub are injected via overrides.
|
|
679
|
+
// attachInternals() is intercepted because the designer rootEl is a plain HTMLDivElement
|
|
680
|
+
// (not a custom element), so the native call would throw NotSupportedError.
|
|
681
|
+
let _internalsStub = null;
|
|
680
682
|
const overrides = {
|
|
681
683
|
shadowRoot,
|
|
682
684
|
_getDomElement(id) {
|
|
@@ -686,6 +688,24 @@ export class IobrokerWebuiScreenEditor extends BaseCustomWebComponentConstructor
|
|
|
686
688
|
const el = overrides._getDomElement(id);
|
|
687
689
|
if (el) el.addEventListener(evtName, handler);
|
|
688
690
|
},
|
|
691
|
+
attachInternals() {
|
|
692
|
+
if (!_internalsStub) {
|
|
693
|
+
_internalsStub = {
|
|
694
|
+
setFormValue() {},
|
|
695
|
+
setValidity() {},
|
|
696
|
+
checkValidity() { return true; },
|
|
697
|
+
reportValidity() { return true; },
|
|
698
|
+
form: null,
|
|
699
|
+
validity: { valid: true, valueMissing: false, typeMismatch: false, patternMismatch: false, tooLong: false, tooShort: false, rangeUnderflow: false, rangeOverflow: false, stepMismatch: false, badInput: false, customError: false },
|
|
700
|
+
validationMessage: '',
|
|
701
|
+
willValidate: false,
|
|
702
|
+
labels: [],
|
|
703
|
+
states: { add() {}, delete() {}, has() { return false; }, clear() {}, forEach() {} },
|
|
704
|
+
role: null,
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
return _internalsStub;
|
|
708
|
+
},
|
|
689
709
|
};
|
|
690
710
|
const facade = new Proxy(rootEl, {
|
|
691
711
|
get(target, prop, receiver) {
|