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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "mywebui",
4
- "version": "1.37.87",
4
+ "version": "1.37.88",
5
5
  "titleLang": {
6
6
  "en": "mywebui",
7
7
  "de": "mywebui",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.37.87",
3
+ "version": "1.37.88",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -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 (attachInternals, querySelector,
678
- // closest, matches, getBoundingClientRect, etc.) work automatically.
679
- // Custom WebUI API (_getDomElement, _assignEvent, shadowRoot) is injected via the handler.
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) {