iobroker.mywebui 1.59.0 → 1.60.0
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/default-controls/controls/navigation/app-bar.control +1 -1
- package/default-controls/controls/navigation/sidebar.control +1 -1
- package/dist/backend/3d-editor-integration.js +1 -1
- package/dist/backend/ImportmapCreator.js +1 -1
- package/dist/backend/UploadHelper.js +1 -1
- package/dist/backend/main.js +1 -1
- package/io-package.json +1 -1
- package/package.json +1 -1
- package/www/3d-editor/js/Animation.js +1 -1
- package/www/3d-editor/js/AnimationResizer.js +1 -1
- package/www/3d-editor/js/Command.js +1 -1
- package/www/3d-editor/js/Config.js +1 -1
- package/www/3d-editor/js/Editor.js +1 -1
- package/www/3d-editor/js/EditorControls.js +1 -1
- package/www/3d-editor/js/GLTFImportDialog.js +1 -1
- package/www/3d-editor/js/History.js +1 -1
- package/www/3d-editor/js/Loader.js +1 -1
- package/www/3d-editor/js/LoaderUtils.js +1 -1
- package/www/3d-editor/js/Menubar.Add.js +1 -1
- package/www/3d-editor/js/Menubar.Edit.js +1 -1
- package/www/3d-editor/js/Menubar.File.js +1 -1
- package/www/3d-editor/js/Menubar.Help.js +1 -1
- package/www/3d-editor/js/Menubar.Render.js +1 -1
- package/www/3d-editor/js/Menubar.Status.js +1 -1
- package/www/3d-editor/js/Menubar.View.js +1 -1
- package/www/3d-editor/js/Menubar.js +1 -1
- package/www/3d-editor/js/Player.js +1 -1
- package/www/3d-editor/js/Resizer.js +1 -1
- package/www/3d-editor/js/Script.js +1 -1
- package/www/3d-editor/js/Selector.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.BoxGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.BufferGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.CapsuleGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.CircleGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.CylinderGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.DodecahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.ExtrudeGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.IcosahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.LatheGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.Modifiers.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.OctahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.PlaneGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.RingGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.ShapeGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.SphereGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TetrahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TextGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TorusGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TorusKnotGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TubeGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.BooleanProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.ColorProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.ConstantProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.MapProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.NumberProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.Program.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.RangeValueProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.js +1 -1
- package/www/3d-editor/js/Sidebar.Object.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.App.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.Materials.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.Renderer.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.Resources.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.js +1 -1
- package/www/3d-editor/js/Sidebar.Properties.js +1 -1
- package/www/3d-editor/js/Sidebar.Scene.js +1 -1
- package/www/3d-editor/js/Sidebar.Script.js +1 -1
- package/www/3d-editor/js/Sidebar.Settings.History.js +1 -1
- package/www/3d-editor/js/Sidebar.Settings.Shortcuts.js +1 -1
- package/www/3d-editor/js/Sidebar.Settings.js +1 -1
- package/www/3d-editor/js/Sidebar.js +1 -1
- package/www/3d-editor/js/Storage.js +1 -1
- package/www/3d-editor/js/Strings.js +1 -1
- package/www/3d-editor/js/TextureParametersDialog.js +1 -1
- package/www/3d-editor/js/Toolbar.js +1 -1
- package/www/3d-editor/js/Viewport.Controls.js +1 -1
- package/www/3d-editor/js/Viewport.Info.js +1 -1
- package/www/3d-editor/js/Viewport.Pathtracer.js +1 -1
- package/www/3d-editor/js/Viewport.ViewHelper.js +1 -1
- package/www/3d-editor/js/Viewport.XR.js +1 -1
- package/www/3d-editor/js/Viewport.js +1 -1
- package/www/3d-editor/js/commands/AddObjectCommand.js +1 -1
- package/www/3d-editor/js/commands/AddScriptCommand.js +1 -1
- package/www/3d-editor/js/commands/Commands.js +1 -1
- package/www/3d-editor/js/commands/MoveObjectCommand.js +1 -1
- package/www/3d-editor/js/commands/MultiCmdsCommand.js +1 -1
- package/www/3d-editor/js/commands/RemoveObjectCommand.js +1 -1
- package/www/3d-editor/js/commands/RemoveScriptCommand.js +1 -1
- package/www/3d-editor/js/commands/SetColorCommand.js +1 -1
- package/www/3d-editor/js/commands/SetGeometryCommand.js +1 -1
- package/www/3d-editor/js/commands/SetGeometryValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialColorCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialMapCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialRangeCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialVectorCommand.js +1 -1
- package/www/3d-editor/js/commands/SetPositionCommand.js +1 -1
- package/www/3d-editor/js/commands/SetRotationCommand.js +1 -1
- package/www/3d-editor/js/commands/SetScaleCommand.js +1 -1
- package/www/3d-editor/js/commands/SetSceneCommand.js +1 -1
- package/www/3d-editor/js/commands/SetScriptValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetShadowValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetTextureParametersCommand.js +1 -1
- package/www/3d-editor/js/commands/SetUuidCommand.js +1 -1
- package/www/3d-editor/js/commands/SetValueCommand.js +1 -1
- package/www/dist/frontend/bundle/chunk-3C6XC7RW.js +1 -1
- package/www/dist/frontend/bundle/chunk-3WGNLIWJ.js +21 -0
- package/www/dist/frontend/bundle/chunk-43HEBO5G.js +3 -3
- package/www/dist/frontend/bundle/chunk-5MUGMRXU.js +1 -1
- package/www/dist/frontend/bundle/chunk-5UBRCTRX.js +3 -3
- package/www/dist/frontend/bundle/chunk-65A3PNMG.js +1 -1
- package/www/dist/frontend/bundle/chunk-7CWDQGAG.js +3 -3
- package/www/dist/frontend/bundle/chunk-7PT7IGUJ.js +3 -3
- package/www/dist/frontend/bundle/chunk-AI5PDLDE.js +3 -3
- package/www/dist/frontend/bundle/chunk-AWKVUUKN.js +3 -3
- package/www/dist/frontend/bundle/chunk-B6NXWGSB.js +1 -1
- package/www/dist/frontend/bundle/chunk-BHSHNRXW.js +1 -1
- package/www/dist/frontend/bundle/chunk-BVONDEOL.js +3 -3
- package/www/dist/frontend/bundle/chunk-DNCD2F6X.js +2 -2
- package/www/dist/frontend/bundle/chunk-FHF6DL5U.js +1 -1
- package/www/dist/frontend/bundle/chunk-FO56TEZH.js +3 -3
- package/www/dist/frontend/bundle/chunk-GLQNGCFL.js +1 -1
- package/www/dist/frontend/bundle/chunk-JBDSDK2C.js +3 -3
- package/www/dist/frontend/bundle/chunk-K6IV7LKW.js +1 -1
- package/www/dist/frontend/bundle/chunk-KY73TL6O.js +3 -3
- package/www/dist/frontend/bundle/chunk-MECWXZRN.js +1 -1
- package/www/dist/frontend/bundle/chunk-N2YIZTB2.js +1 -0
- package/www/dist/frontend/bundle/chunk-NQ7L7KNT.js +3 -3
- package/www/dist/frontend/bundle/chunk-P7EOR36H.js +1 -1
- package/www/dist/frontend/bundle/chunk-PJYK24KZ.js +1 -1
- package/www/dist/frontend/bundle/chunk-QJJGP23I.js +1 -1
- package/www/dist/frontend/bundle/chunk-QV4IBWXA.js +1 -1
- package/www/dist/frontend/bundle/chunk-R6IQDPAP.js +3 -3
- package/www/dist/frontend/bundle/chunk-SE6N4ZEN.js +1 -1
- package/www/dist/frontend/bundle/chunk-SQHXO2IT.js +3 -3
- package/www/dist/frontend/bundle/chunk-UIP324PP.js +1 -1
- package/www/dist/frontend/bundle/chunk-V4C5FGJL.js +2 -2
- package/www/dist/frontend/bundle/chunk-WED7CGWA.js +2 -2
- package/www/dist/frontend/bundle/chunk-WQ5H5LTG.js +2 -2
- package/www/dist/frontend/bundle/chunk-WU54NCEU.js +1 -1
- package/www/dist/frontend/bundle/chunk-XFO5FUCN.js +1 -1
- package/www/dist/frontend/bundle/chunk-YUSK4FN3.js +3 -3
- package/www/dist/frontend/bundle/chunk-Z34BSG5O.js +3 -3
- package/www/dist/frontend/bundle/common/IobrokerHandler.js +1 -1
- package/www/dist/frontend/bundle/runtime/CustomControls.js +1 -1
- package/www/dist/frontend/bundle/runtime/ScreenViewer.js +1 -1
- package/www/dist/frontend/bundle/runtime/controls.js +4 -4
- package/www/dist/frontend/bundle/runtime/init.js +3 -3
- package/www/dist/frontend/common/Common.globals.js +1 -1
- package/www/dist/frontend/common/IobrokerHandler.js +1 -1
- package/www/dist/frontend/common/Runtime.js +1 -1
- package/www/dist/frontend/config/CommandHandling.js +1 -1
- package/www/dist/frontend/config/ConfigureWebcomponentDesigner.js +1 -1
- package/www/dist/frontend/config/DockHelper.js +1 -1
- package/www/dist/frontend/config/IobrokerWebui3DDriveEngine.js +1 -1
- package/www/dist/frontend/config/IobrokerWebui3DScreenEditor.js +3 -3
- package/www/dist/frontend/config/IobrokerWebui3DScreenPropertiesPanel.js +2 -2
- package/www/dist/frontend/config/IobrokerWebui3DScreenViewer.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiAppShell.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiBindingsEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiConfirmationWrapper.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiControlPropertiesEditor.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiDynamicPropsEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiEventAssignment.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiIconsView.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiMonacoEditor.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiPropertyGrid.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiScreenEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiScreensView.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiSignalPropertyEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiSolutionExplorer.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiTranslationEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiWidgetGallery.js +3 -3
- package/www/dist/frontend/helper/DialogHelper.js +3 -3
- package/www/dist/frontend/helper/EsprimaHelper.js +1 -1
- package/www/dist/frontend/helper/Helper.js +1 -1
- package/www/dist/frontend/helper/LayoutHelper.js +1 -1
- package/www/dist/frontend/helper/XmlHelper.js +1 -1
- package/www/dist/frontend/helper/ZipHelper.js +1 -1
- package/www/dist/frontend/runtime/AnimationService.js +1 -1
- package/www/dist/frontend/runtime/CustomControls.js +1 -1
- package/www/dist/frontend/runtime/DynamicElementProperties.js +1 -1
- package/www/dist/frontend/runtime/HabPanelLikeMenu.js +3 -3
- package/www/dist/frontend/runtime/NavigationShell.js +1 -1
- package/www/dist/frontend/runtime/ScreenViewer.js +2 -2
- package/www/dist/frontend/runtime/TranslateableText.js +2 -2
- package/www/dist/frontend/runtime/VisibilityService.js +1 -1
- package/www/dist/frontend/runtime/controls.js +1 -1
- package/www/dist/frontend/runtime/init.js +1 -1
- package/www/dist/frontend/scripting/IobrokerWebuiScriptSystem.js +1 -1
- package/www/dist/frontend/scripting/blockly/OpenScreen.js +1 -1
- package/www/dist/frontend/scripting/blockly/webuiBlocklyToolbox.js +1 -1
- package/www/dist/frontend/services/DynamicPropertiesHelper.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableLocalObjectsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableObjectDragDropService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableObjectsForPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableObjectsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiConfigButtonProvider.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiCopyPasteService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiCustomControlEventsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiCustomElementContextMenu.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiDemoProviderService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiDynamicPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiEventsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiExternalDragDropService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiLitPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiPropertyGroupsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiRefactorService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiScreenContextMenu.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiSpecialPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiSpectrumEditorService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiVisibilityPropertiesService.js +1 -1
- package/www/dist/frontend/services/LayoutComponentsPropertiesService.js +1 -1
- package/www/dist/frontend/widgets/OrthoFlowLineTool.js +1 -1
- package/www/dist/frontend/widgets/customElementsObserver.js +1 -1
- package/www/dist/frontend/widgets/importWidgetFiles.js +1 -1
- package/www/dist/frontend/widgets/importWidgetFilesRuntime.js +1 -1
- package/www/dist/frontend/widgets/layout-components.js +1 -1
- package/www/dist/frontend/widgets/layout-placement-services.js +1 -1
- package/www/dist/frontend/widgets/testElement.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"properties": {"caption": {"type": "string", "default": ""}, "icon": {"type": "string", "default": ""}, "bgColor": {"type": "color", "default": ""}}, "settings": {"width": "100%", "height": "48px"}, "html": "<div id=\"bar\" class=\"bar\"><img id=\"barIcon\" class=\"bar-icon\" alt=\"\" style=\"display:none;\"/><span id=\"barCap\" class=\"bar-cap\"></span></div>", "style": ":host{display:block;width:100%;height:100%;}\n.bar{display:flex;align-items:center;gap:12px;height:100%;padding:0 16px 0 60px;color:#fff;box-sizing:border-box;background:var(--bar-bg,linear-gradient(90deg,#1e3c72 0%,#2a5298 100%));box-shadow:0 2px 12px rgba(0,0,0,.25);}\n.bar-icon{height:30px;width:auto;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3));}\n.bar-cap{font-size:17px;font-weight:600;letter-spacing:.3px;}", "script": "export function init(instance){\n instance._bindingsRefresh();\n const resolveImg = (img) => { if(!img) return ''; if(/^(https?:|data:|blob:|\\/)/.test(img)) return img; try{ return (window.IOB&&window.IOB.imagePrefix?window.IOB.imagePrefix:'')+img; }catch(e){ return img; } };\n const cfg = (window.IOB && window.IOB.config && window.IOB.config.appBar) || {};\n const upd = () => {\n const bar=instance._getDomElement('bar'), ic=instance._getDomElement('barIcon'), cap=instance._getDomElement('barCap');\n const bg = instance.bgColor || cfg.bgColor;\n if(bg) instance.style.setProperty('--bar-bg', bg);\n const icon = instance.icon || cfg.icon;\n if(ic){ if(icon){ ic.src=resolveImg(icon); ic.style.display=''; } else ic.style.display='none'; }\n if(cap) cap.textContent = instance.caption || cfg.caption || '';\n };\n instance._assignEvent('caption-changed', upd);\n instance._assignEvent('icon-changed', upd);\n instance._assignEvent('bg-color-changed', upd);\n upd();\n}"}
|
|
1
|
+
{"properties": {"caption": {"type": "string", "default": ""}, "icon": {"type": "string", "default": ""}, "bgColor": {"type": "color", "default": ""}}, "settings": {"width": "100%", "height": "48px"}, "html": "<div id=\"bar\" class=\"bar\"><div id=\"slotLeft\" class=\"bar-slot\"></div><img id=\"barIcon\" class=\"bar-icon\" alt=\"\" style=\"display:none;\"/><span id=\"barCap\" class=\"bar-cap\"></span><div id=\"slotCenter\" class=\"bar-slot bar-grow\" style=\"justify-content:center;\"></div><div id=\"slotRight\" class=\"bar-slot\"></div></div>", "style": ":host{display:block;width:100%;height:100%;}\n.bar{display:flex;align-items:center;gap:12px;height:100%;padding:0 16px 0 60px;color:#fff;box-sizing:border-box;background:var(--bar-bg,linear-gradient(90deg,#1e3c72 0%,#2a5298 100%));box-shadow:0 2px 12px rgba(0,0,0,.25);}\n.bar-icon{height:30px;width:auto;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3));}\n.bar-cap{font-size:17px;font-weight:600;letter-spacing:.3px;}\n.bar-slot{display:flex;align-items:center;gap:8px;}\n.bar-grow{flex:1;min-width:0;}", "script": "export function init(instance){\n instance._bindingsRefresh();\n const resolveImg = (img) => { if(!img) return ''; if(/^(https?:|data:|blob:|\\/)/.test(img)) return img; try{ return (window.IOB&&window.IOB.imagePrefix?window.IOB.imagePrefix:'')+img; }catch(e){ return img; } };\n const cfg = (window.IOB && window.IOB.config && window.IOB.config.appBar) || {};\n const isDesigner = !!document.querySelector('iobroker-webui-app-shell');\n function htmlFromDef(def){\n let attrs='';\n if(def.defaultAttributes) for(const a in def.defaultAttributes){ const v=def.defaultAttributes[a]; attrs+=' '+a+'=\"'+String(typeof v==='object'?JSON.stringify(v):v).replace(/\"/g,'"')+'\"'; }\n let style='';\n if(def.defaultStyles) for(const k in def.defaultStyles) style+=k+':'+def.defaultStyles[k]+';';\n if(def.defaultWidth) style+='width:'+def.defaultWidth+';';\n if(def.defaultHeight) style+='height:'+def.defaultHeight+';';\n return '<'+def.tag+attrs+(style?' style=\"'+style+'\"':'')+'>'+(def.defaultContent||'')+'</'+def.tag+'>';\n }\n function wireSlot(zone, cfgRoot, key){\n if(!zone) return;\n zone.innerHTML = (cfgRoot && cfgRoot.slots && cfgRoot.slots[key]) || '';\n if(!isDesigner) return;\n if(!zone.innerHTML.trim()){ zone.dataset.empty='1'; zone.style.minHeight='30px'; zone.style.outline='1px dashed rgba(255,255,255,.28)'; zone.style.borderRadius='8px'; zone.style.margin='4px 8px'; }\n zone.addEventListener('dragover', e=>{ if(e.dataTransfer && e.dataTransfer.types && e.dataTransfer.types.indexOf('text/json/elementdefintion')>=0){ e.preventDefault(); zone.style.background='rgba(255,255,255,.18)'; } });\n zone.addEventListener('dragleave', ()=>{ zone.style.background=''; });\n zone.addEventListener('drop', e=>{ e.preventDefault(); e.stopPropagation(); zone.style.background='';\n try{ const td=e.dataTransfer.getData('text/json/elementdefintion'); if(!td) return; const def=JSON.parse(td); const html=htmlFromDef(def);\n if(!cfgRoot.slots) cfgRoot.slots={}; cfgRoot.slots[key]=(cfgRoot.slots[key]||'')+html;\n if(window.IOB && window.IOB.saveConfig) window.IOB.saveConfig();\n }catch(err){ console.warn('[nav] slot drop failed', err); }\n });\n }\n const upd = () => {\n const bar=instance._getDomElement('bar'), ic=instance._getDomElement('barIcon'), cap=instance._getDomElement('barCap');\n const bg = instance.bgColor || cfg.bgColor;\n if(bg) instance.style.setProperty('--bar-bg', bg);\n const icon = instance.icon || cfg.icon;\n if(ic){ if(icon){ ic.src=resolveImg(icon); ic.style.display=''; } else ic.style.display='none'; }\n if(cap) cap.textContent = instance.caption || cfg.caption || '';\n };\n instance._assignEvent('caption-changed', upd);\n instance._assignEvent('icon-changed', upd);\n instance._assignEvent('bg-color-changed', upd);\n upd();\n wireSlot(instance._getDomElement('slotLeft'), cfg, 'left');\n wireSlot(instance._getDomElement('slotCenter'), cfg, 'center');\n wireSlot(instance._getDomElement('slotRight'), cfg, 'right');\n}"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"properties": {}, "settings": {"width": "220px", "height": "100%"}, "html": "<div id=\"sb\" class=\"sb\"><div id=\"sbHdr\" class=\"sb-hdr\"></div><div id=\"sbItems\" class=\"sb-items\"></div></div>", "style": ":host{display:block;width:100%;height:100%;box-sizing:border-box;}\n.sb{display:flex;flex-direction:column;height:100%;width:100%;background:var(--sb-bg,linear-gradient(180deg,#1e3c72 0%,#2a5298 100%));color:var(--sb-fg,rgba(255,255,255,.9));box-shadow:2px 0 18px rgba(0,0,0,.28);box-sizing:border-box;}\n.sb-hdr{padding:18px 16px 14px;font-weight:700;font-size:16px;letter-spacing:.5px;color:var(--sb-hdr-fg,#fff);border-bottom:1px solid rgba(255,255,255,.12);white-space:nowrap;overflow:hidden;}\n.sb-items{flex:1;overflow-y:auto;overflow-x:hidden;padding:8px 0;}\n.sb-items::-webkit-scrollbar{width:6px;}\n.sb-items::-webkit-scrollbar-thumb{background:rgba(255,255,255,.3);border-radius:3px;}", "script": "export function init(instance){\n instance._bindingsRefresh();\n const IOB = window.IOB;\n const cfg = (IOB && IOB.config && IOB.config.navigation) || {};\n const isDesigner = !!document.querySelector('iobroker-webui-app-shell');\n const hdr=instance._getDomElement('sbHdr'), items=instance._getDomElement('sbItems');\n if(cfg.bgColor) instance.style.setProperty('--sb-bg', cfg.bgColor);\n if(cfg.textColor){ instance.style.setProperty('--sb-fg', cfg.textColor); instance.style.setProperty('--mi-fg', cfg.textColor); }\n if(cfg.menuHeaderTextColor) instance.style.setProperty('--sb-hdr-fg', cfg.menuHeaderTextColor);\n if(cfg.bgColorSelected){ instance.style.setProperty('--mi-active', cfg.bgColorSelected); instance.style.setProperty('--mi-active-icon', cfg.bgColorSelected); }\n if(cfg.textColorSelected) instance.style.setProperty('--mi-active-fg', cfg.textColorSelected);\n if(hdr){ hdr.textContent=cfg.menuHeaderText||''; hdr.style.display=cfg.menuHeaderText?'':'none'; }\n let state='expanded'; const ICONS_W=64; let burger=null; let hasItems=false;\n const navWidth = cfg.menuWidth ? (/^\\d+$/.test(String(cfg.menuWidth))?cfg.menuWidth+'px':String(cfg.menuWidth)) : '220px';\n const setActive=(name)=>{ if(items) items.querySelectorAll('webui-navigation-menu-item').forEach(mi=>{ mi.selected=(mi.screenName===name); }); };\n const navTo=(name)=>{ if(IOB&&IOB.changeView) IOB.changeView.emit(name); setActive(name); if(cfg.hideAfterSelection) setState('hidden'); };\n async function loadEntries(){\n if(!IOB||!IOB.getAllNames) return [];\n const names=await IOB.getAllNames('screen').catch(()=>[]);\n const list=[];\n for(const n of names){ const o=await IOB.getWebuiObject('screen',n).catch(()=>null); const nv=o&&o.settings&&o.settings.navigation; if(nv&&nv.show) list.push({name:n,title:nv.title||n,order:parseFloat(nv.order)||0,image:nv.image||''}); }\n list.sort((a,b)=>a.order-b.order); return list;\n }\n async function render(){\n const list=await loadEntries(); hasItems=list.length>0;\n if(items){ items.innerHTML='';\n for(const e of list){ const mi=document.createElement('webui-navigation-menu-item'); mi.screenName=e.name; mi.title=e.title; mi.image=e.image; mi.addEventListener('menuitemclick',()=>navTo(e.name)); items.appendChild(mi); }\n }\n if(!isDesigner){ if(hasItems && !cfg.hideMenu) applyRuntimeLayout(); else { const v=document.getElementById('viewer'); if(v){ v.style.left='0'; v.style.width='100%'; } instance.style.display='none'; } }\n }\n function applyRuntimeLayout(){\n const ab=document.getElementById('__nav-appbar-host'); const top=ab?ab.offsetHeight:0;\n instance.style.position='fixed'; instance.style.left='0'; instance.style.bottom='0'; instance.style.top=top+'px';\n instance.style.zIndex='99999'; instance.style.overflow='hidden'; instance.style.transition='width .2s ease,transform .2s ease';\n if(!burger){ burger=document.createElement('div'); burger.id='__nav-burger'; burger.textContent='☰'; const inBar=top>0; burger.style.cssText='position:fixed;top:'+(inBar?0:8)+'px;left:'+(inBar?0:8)+'px;z-index:100002;width:'+(inBar?top:42)+'px;height:'+(inBar?top:42)+'px;display:flex;align-items:center;justify-content:center;font-size:22px;cursor:pointer;'+(inBar?'':'border-radius:8px;')+'background:'+(cfg.showButtonBg||(inBar?'transparent':'rgba(0,0,0,.45)'))+';color:'+(cfg.showButtonColor||'#fff')+';transition:background .15s;'; burger.onclick=cycle; document.body.appendChild(burger); }\n setState(state);\n }\n function setState(s){\n state=s; const v=document.getElementById('viewer'); const top=parseInt(instance.style.top)||0; let left='0px';\n const compact=(state==='icons');\n if(items) items.querySelectorAll('webui-navigation-menu-item').forEach(mi=>mi.compact=compact);\n if(state==='expanded'){ instance.style.width=navWidth; instance.style.transform='translateX(0)'; if(hdr)hdr.style.display=cfg.menuHeaderText?'':'none'; left=navWidth; }\n else if(state==='icons'){ instance.style.width=ICONS_W+'px'; instance.style.transform='translateX(0)'; if(hdr)hdr.style.display='none'; left=ICONS_W+'px'; }\n else { instance.style.transform='translateX(-110%)'; left='0px'; }\n if(v){ v.style.left=left; v.style.width='calc(100% - '+left+')'; v.style.top=top+'px'; v.style.height='calc(100% - '+top+'px)'; }\n }\n function cycle(){ const o=['expanded','icons','hidden']; let n=o[(o.indexOf(state)+1)%o.length]; if(n==='hidden'&&cfg.doNotHideCompletely)n='icons'; setState(n); }\n render();\n if(IOB&&IOB.changeView) IOB.changeView.on(v=>setActive(v));\n const sv=document.getElementById('viewer'); if(sv&&sv.screenName) setActive(sv.screenName);\n}"}
|
|
1
|
+
{"properties": {}, "settings": {"width": "220px", "height": "100%"}, "html": "<div id=\"sb\" class=\"sb\"><div id=\"sbHdr\" class=\"sb-hdr\"></div><div id=\"slotTop\" class=\"sb-slot\"></div><div id=\"sbItems\" class=\"sb-items\"></div><div id=\"slotBottom\" class=\"sb-slot\"></div></div>", "style": ":host{display:block;width:100%;height:100%;box-sizing:border-box;}\n.sb{display:flex;flex-direction:column;height:100%;width:100%;background:var(--sb-bg,linear-gradient(180deg,#1e3c72 0%,#2a5298 100%));color:var(--sb-fg,rgba(255,255,255,.9));box-shadow:2px 0 18px rgba(0,0,0,.28);box-sizing:border-box;}\n.sb-hdr{padding:18px 16px 14px;font-weight:700;font-size:16px;letter-spacing:.5px;color:var(--sb-hdr-fg,#fff);border-bottom:1px solid rgba(255,255,255,.12);white-space:nowrap;overflow:hidden;}\n.sb-items{flex:1;overflow-y:auto;overflow-x:hidden;padding:8px 0;}\n.sb-items::-webkit-scrollbar{width:6px;}\n.sb-items::-webkit-scrollbar-thumb{background:rgba(255,255,255,.3);border-radius:3px;}\n.sb-slot{display:block;}", "script": "export function init(instance){\n instance._bindingsRefresh();\n const IOB = window.IOB;\n const cfg = (IOB && IOB.config && IOB.config.navigation) || {};\n function htmlFromDef(def){\n let attrs='';\n if(def.defaultAttributes) for(const a in def.defaultAttributes){ const v=def.defaultAttributes[a]; attrs+=' '+a+'=\"'+String(typeof v==='object'?JSON.stringify(v):v).replace(/\"/g,'"')+'\"'; }\n let style='';\n if(def.defaultStyles) for(const k in def.defaultStyles) style+=k+':'+def.defaultStyles[k]+';';\n if(def.defaultWidth) style+='width:'+def.defaultWidth+';';\n if(def.defaultHeight) style+='height:'+def.defaultHeight+';';\n return '<'+def.tag+attrs+(style?' style=\"'+style+'\"':'')+'>'+(def.defaultContent||'')+'</'+def.tag+'>';\n }\n function wireSlot(zone, cfgRoot, key){\n if(!zone) return;\n zone.innerHTML = (cfgRoot && cfgRoot.slots && cfgRoot.slots[key]) || '';\n if(!isDesigner) return;\n if(!zone.innerHTML.trim()){ zone.dataset.empty='1'; zone.style.minHeight='30px'; zone.style.outline='1px dashed rgba(255,255,255,.28)'; zone.style.borderRadius='8px'; zone.style.margin='4px 8px'; }\n zone.addEventListener('dragover', e=>{ if(e.dataTransfer && e.dataTransfer.types && e.dataTransfer.types.indexOf('text/json/elementdefintion')>=0){ e.preventDefault(); zone.style.background='rgba(255,255,255,.18)'; } });\n zone.addEventListener('dragleave', ()=>{ zone.style.background=''; });\n zone.addEventListener('drop', e=>{ e.preventDefault(); e.stopPropagation(); zone.style.background='';\n try{ const td=e.dataTransfer.getData('text/json/elementdefintion'); if(!td) return; const def=JSON.parse(td); const html=htmlFromDef(def);\n if(!cfgRoot.slots) cfgRoot.slots={}; cfgRoot.slots[key]=(cfgRoot.slots[key]||'')+html;\n if(window.IOB && window.IOB.saveConfig) window.IOB.saveConfig();\n }catch(err){ console.warn('[nav] slot drop failed', err); }\n });\n }\n const isDesigner = !!document.querySelector('iobroker-webui-app-shell');\n const hdr=instance._getDomElement('sbHdr'), items=instance._getDomElement('sbItems');\n if(cfg.bgColor) instance.style.setProperty('--sb-bg', cfg.bgColor);\n if(cfg.textColor){ instance.style.setProperty('--sb-fg', cfg.textColor); instance.style.setProperty('--mi-fg', cfg.textColor); }\n if(cfg.menuHeaderTextColor) instance.style.setProperty('--sb-hdr-fg', cfg.menuHeaderTextColor);\n if(cfg.bgColorSelected){ instance.style.setProperty('--mi-active', cfg.bgColorSelected); instance.style.setProperty('--mi-active-icon', cfg.bgColorSelected); }\n if(cfg.textColorSelected) instance.style.setProperty('--mi-active-fg', cfg.textColorSelected);\n if(hdr){ hdr.textContent=cfg.menuHeaderText||''; hdr.style.display=cfg.menuHeaderText?'':'none'; }\n let state='expanded'; const ICONS_W=64; let burger=null; let hasItems=false;\n const navWidth = cfg.menuWidth ? (/^\\d+$/.test(String(cfg.menuWidth))?cfg.menuWidth+'px':String(cfg.menuWidth)) : '220px';\n const setActive=(name)=>{ if(items) items.querySelectorAll('webui-navigation-menu-item').forEach(mi=>{ mi.selected=(mi.screenName===name); }); };\n const navTo=(name)=>{ if(IOB&&IOB.changeView) IOB.changeView.emit(name); setActive(name); if(cfg.hideAfterSelection) setState('hidden'); };\n async function loadEntries(){\n if(!IOB||!IOB.getAllNames) return [];\n const names=await IOB.getAllNames('screen').catch(()=>[]);\n const list=[];\n for(const n of names){ const o=await IOB.getWebuiObject('screen',n).catch(()=>null); const nv=o&&o.settings&&o.settings.navigation; if(nv&&nv.show) list.push({name:n,title:nv.title||n,order:parseFloat(nv.order)||0,image:nv.image||''}); }\n list.sort((a,b)=>a.order-b.order); return list;\n }\n async function render(){\n const list=await loadEntries(); hasItems=list.length>0;\n if(items){ items.innerHTML='';\n for(const e of list){ const mi=document.createElement('webui-navigation-menu-item'); mi.screenName=e.name; mi.title=e.title; mi.image=e.image; mi.addEventListener('menuitemclick',()=>navTo(e.name)); items.appendChild(mi); }\n }\n if(!isDesigner){ if(hasItems && !cfg.hideMenu) applyRuntimeLayout(); else { const v=document.getElementById('viewer'); if(v){ v.style.left='0'; v.style.width='100%'; } instance.style.display='none'; } }\n }\n function applyRuntimeLayout(){\n const ab=document.getElementById('__nav-appbar-host'); const top=ab?ab.offsetHeight:0;\n instance.style.position='fixed'; instance.style.left='0'; instance.style.bottom='0'; instance.style.top=top+'px';\n instance.style.zIndex='99999'; instance.style.overflow='hidden'; instance.style.transition='width .2s ease,transform .2s ease';\n if(!burger){ burger=document.createElement('div'); burger.id='__nav-burger'; burger.textContent='☰'; const inBar=top>0; burger.style.cssText='position:fixed;top:'+(inBar?0:8)+'px;left:'+(inBar?0:8)+'px;z-index:100002;width:'+(inBar?top:42)+'px;height:'+(inBar?top:42)+'px;display:flex;align-items:center;justify-content:center;font-size:22px;cursor:pointer;'+(inBar?'':'border-radius:8px;')+'background:'+(cfg.showButtonBg||(inBar?'transparent':'rgba(0,0,0,.45)'))+';color:'+(cfg.showButtonColor||'#fff')+';transition:background .15s;'; burger.onclick=cycle; document.body.appendChild(burger); }\n setState(state);\n }\n function setState(s){\n state=s; const v=document.getElementById('viewer'); const top=parseInt(instance.style.top)||0; let left='0px';\n const compact=(state==='icons');\n if(items) items.querySelectorAll('webui-navigation-menu-item').forEach(mi=>mi.compact=compact);\n if(state==='expanded'){ instance.style.width=navWidth; instance.style.transform='translateX(0)'; if(hdr)hdr.style.display=cfg.menuHeaderText?'':'none'; left=navWidth; }\n else if(state==='icons'){ instance.style.width=ICONS_W+'px'; instance.style.transform='translateX(0)'; if(hdr)hdr.style.display='none'; left=ICONS_W+'px'; }\n else { instance.style.transform='translateX(-110%)'; left='0px'; }\n if(v){ v.style.left=left; v.style.width='calc(100% - '+left+')'; v.style.top=top+'px'; v.style.height='calc(100% - '+top+'px)'; }\n }\n function cycle(){ const o=['expanded','icons','hidden']; let n=o[(o.indexOf(state)+1)%o.length]; if(n==='hidden'&&cfg.doNotHideCompletely)n='icons'; setState(n); }\n wireSlot(instance._getDomElement('slotTop'), cfg, 'top');\n wireSlot(instance._getDomElement('slotBottom'), cfg, 'bottom');\n render();\n if(IOB&&IOB.changeView) IOB.changeView.on(v=>setActive(v));\n const sv=document.getElementById('viewer'); if(sv&&sv.screenName) setActive(sv.screenName);\n}"}
|