UNPKG

iobroker.vis-2

Version:

Next generation graphical user interface for ioBroker.

4 lines (3 loc) 11.8 kB
import{i as ae,w as ie,T as ve,v as xe,k as Se,n as we,q as le,t as be,a as x,x as Te,A as Re,z as _e,B as Ee,y as Me,u as B,m as Pe}from"./createSvgIcon-CbfCWRSf.js";import{i as u}from"./iobroker_vis__loadShare___mf_0_mui_mf_1_system__loadShare__-DH7sF_c4.js";import{n as ze,o as O,m as $e,a as q,g as G,j as f,c as X,b as K}from"./createStyled-KRzCdWth.js";import{aK as He,aN as je,h as ke,aM as Fe,aL as Ne,D as ce,u as Ue,P as Ae,a0 as U,T as L,t as ee,l as Ie,aw as Oe,r as De,al as te}from"./Dialog-alBgzgEa.js";import{i as H}from"./iobroker_vis__loadShare__react__loadShare__-CBSDylZ8.js";import"./iobroker_vis__loadShare__prop_mf_2_types__loadShare__-IJSryeM_.js";function Ve(t){const{defaultProps:e={},mixins:o={},overrides:n={},palette:c={},props:i={},styleOverrides:d={},...p}=t,a={...p,components:{}};Object.keys(e).forEach(r=>{const l=a.components[r]||{};l.defaultProps=e[r],a.components[r]=l}),Object.keys(i).forEach(r=>{const l=a.components[r]||{};l.defaultProps=i[r],a.components[r]=l}),Object.keys(d).forEach(r=>{const l=a.components[r]||{};l.styleOverrides=d[r],a.components[r]=l}),Object.keys(n).forEach(r=>{const l=a.components[r]||{};l.styleOverrides=n[r],a.components[r]=l}),a.spacing=u.createSpacing(t.spacing);const m=u.createBreakpoints(t.breakpoints||{}),h=a.spacing;a.mixins={gutters:(r={})=>({paddingLeft:h(2),paddingRight:h(2),...r,[m.up("sm")]:{paddingLeft:h(3),paddingRight:h(3),...r[m.up("sm")]}}),...o};const{type:g,mode:S,...b}=c,w=S||g||"light";return a.palette={text:{hint:w==="dark"?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.38)"},mode:w,type:w,...b},a}function Le(t,...e){return ae(ze({unstable_strictMode:!0},t),...e)}let oe=!1;function We(t){return oe||(console.warn(["MUI: createStyles from @mui/material/styles is deprecated.","Please use @mui/styles/createStyles"].join(` `)),oe=!0),t}function re(t){return String(parseFloat(t)).length===String(t).length}function pe(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function E(t){return parseFloat(t)}function Be(t){return(e,o)=>{const n=pe(e);if(n===o)return e;let c=E(e);n!=="px"&&(n==="em"||n==="rem")&&(c=E(e)*E(t));let i=c;if(o!=="px")if(o==="em")i=c/E(t);else if(o==="rem")i=c/E(t);else return e;return parseFloat(i.toFixed(5))+o}}function qe({size:t,grid:e}){const o=t-t%e,n=o+e;return t-o<n-t?o:n}function Ge({lineHeight:t,pixels:e,htmlFontSize:o}){return e/(t*o)}function Ke({cssProperty:t,min:e,max:o,unit:n="rem",breakpoints:c=[600,900,1200],transform:i=null}){const d={[t]:`${e}${n}`},p=(o-e)/c[c.length-1];return c.forEach(a=>{let m=e+p*a;i!==null&&(m=i(m)),d[`@media (min-width:${a}px)`]={[t]:`${Math.round(m*1e4)/1e4}${n}`}}),d}function Ye(t,e={}){const{breakpoints:o=["sm","md","lg"],disableAlign:n=!1,factor:c=2,variants:i=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]}=e,d={...t};d.typography={...d.typography};const p=d.typography,a=Be(p.htmlFontSize),m=o.map(h=>d.breakpoints.values[h]);return i.forEach(h=>{const g=p[h];if(!g)return;const S=parseFloat(a(g.fontSize,"rem"));if(S<=1)return;const b=S,w=1+(b-1)/c;let{lineHeight:r}=g;if(!re(r)&&!n)throw new Error(O(6));re(r)||(r=parseFloat(a(r,"rem"))/parseFloat(S));let l=null;n||(l=y=>qe({size:y,grid:Ge({pixels:4,lineHeight:r,htmlFontSize:p.htmlFontSize})})),p[h]={...g,...Ke({cssProperty:"fontSize",min:w,max:b,unit:"rem",breakpoints:m,transform:l})}}),d}function Je(){throw new Error(O(14))}function Qe(){throw new Error(O(15))}function Xe(){throw new Error(O(16))}let se=!1;function Ze(...t){return se||(console.warn(["MUI: The `experimental_extendTheme` has been stabilized.","","You should use `import { extendTheme } from '@mui/material/styles'`"].join(` `)),se=!0),ie(...t)}function et(){throw new Error(O(19))}const Tt=Object.freeze(Object.defineProperty({__proto__:null,CssVarsProvider:He,Experimental_CssVarsProvider:je,StyledEngineProvider:u.StyledEngineProvider,THEME_ID:ve,ThemeProvider:ke,adaptV4Theme:Ve,alpha:u.alpha,createColorScheme:xe,createMuiTheme:Se,createStyles:We,createTheme:ae,createTransitions:we,css:u.css,darken:u.darken,decomposeColor:u.decomposeColor,duration:le,easing:be,emphasize:u.emphasize,experimentalStyled:x,experimental_extendTheme:Ze,experimental_sx:et,extendTheme:ie,getContrastRatio:u.getContrastRatio,getInitColorSchemeScript:Fe,getLuminance:u.getLuminance,getOverlayAlpha:Te,hexToRgb:u.hexToRgb,hslToRgb:u.hslToRgb,keyframes:u.keyframes,lighten:u.lighten,makeStyles:Je,private_createMixins:Re,private_createTypography:_e,private_excludeVariablesFromRoot:Ee,recomposeColor:u.recomposeColor,responsiveFontSizes:Ye,rgbToHex:u.rgbToHex,shouldSkipGeneratingVar:Me,styled:x,unstable_createBreakpoints:$e,unstable_createMuiStrictModeTheme:Le,unstable_getUnit:pe,unstable_toUnitless:E,useColorScheme:Ne,useTheme:ce,useThemeProps:Ue,withStyles:Qe,withTheme:Xe},Symbol.toStringTag,{value:"Module"}));function tt(t){return G("MuiCard",t)}const Rt=q("MuiCard",["root"]),ot=t=>{const{classes:e}=t;return K({root:["root"]},tt,e)},rt=x(Ae,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})({overflow:"hidden"}),_t=H.forwardRef(function(e,o){const n=B({props:e,name:"MuiCard"}),{className:c,raised:i=!1,...d}=n,p={...n,raised:i},a=ot(p);return f.jsx(rt,{className:X(a.root,c),elevation:i?8:void 0,ref:o,ownerState:p,...d})});function st(t){return G("MuiCardHeader",t)}const W=q("MuiCardHeader",["root","avatar","action","content","title","subheader"]),nt=t=>{const{classes:e}=t;return K({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},st,e)},at=x("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>[{[`& .${W.title}`]:e.title},{[`& .${W.subheader}`]:e.subheader},e.root]})({display:"flex",alignItems:"center",padding:16}),it=x("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),lt=x("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),ct=x("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto",[`.${ee.root}:where(& .${W.title})`]:{display:"block"},[`.${ee.root}:where(& .${W.subheader})`]:{display:"block"}}),Et=H.forwardRef(function(e,o){const n=B({props:e,name:"MuiCardHeader"}),{action:c,avatar:i,component:d="div",disableTypography:p=!1,subheader:a,subheaderTypographyProps:m,title:h,titleTypographyProps:g,slots:S={},slotProps:b={},...w}=n,r={...n,component:d,disableTypography:p},l=nt(r),y={slots:S,slotProps:{title:g,subheader:m,...b}};let T=h;const[R,Y]=U("title",{className:l.title,elementType:L,externalForwardedProps:y,ownerState:r,additionalProps:{variant:i?"body2":"h5",component:"span"}});T!=null&&T.type!==L&&!p&&(T=f.jsx(R,{...Y,children:T}));let M=a;const[j,P]=U("subheader",{className:l.subheader,elementType:L,externalForwardedProps:y,ownerState:r,additionalProps:{variant:i?"body2":"body1",color:"textSecondary",component:"span"}});M!=null&&M.type!==L&&!p&&(M=f.jsx(j,{...P,children:M}));const[D,J]=U("root",{ref:o,className:l.root,elementType:at,externalForwardedProps:{...y,...w,component:d},ownerState:r}),[_,A]=U("avatar",{className:l.avatar,elementType:it,externalForwardedProps:y,ownerState:r}),[k,z]=U("content",{className:l.content,elementType:ct,externalForwardedProps:y,ownerState:r}),[$,F]=U("action",{className:l.action,elementType:lt,externalForwardedProps:y,ownerState:r});return f.jsxs(D,{...J,children:[i&&f.jsx(_,{...A,children:i}),f.jsxs(k,{...z,children:[T,M]}),c&&f.jsx($,{...F,children:c})]})});function pt(t){return G("MuiCardContent",t)}const Mt=q("MuiCardContent",["root"]),dt=t=>{const{classes:e}=t;return K({root:["root"]},pt,e)},ut=x("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:16,"&:last-child":{paddingBottom:24}}),Pt=H.forwardRef(function(e,o){const n=B({props:e,name:"MuiCardContent"}),{className:c,component:i="div",...d}=n,p={...n,component:i},a=dt(p);return f.jsx(ut,{as:i,className:X(a.root,c),ownerState:p,ref:o,...d})});function ht(t){return G("MuiCollapse",t)}const zt=q("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]),mt=t=>{const{orientation:e,classes:o}=t,n={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return K(n,ht,o)},ft=x("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:o}=t;return[e.root,e[o.orientation],o.state==="entered"&&e.entered,o.state==="exited"&&!o.in&&o.collapsedSize==="0px"&&e.hidden]}})(Pe(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),gt=x("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),yt=x("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ne=H.forwardRef(function(e,o){const n=B({props:e,name:"MuiCollapse"}),{addEndListener:c,children:i,className:d,collapsedSize:p="0px",component:a,easing:m,in:h,onEnter:g,onEntered:S,onEntering:b,onExit:w,onExited:r,onExiting:l,orientation:y="vertical",style:T,timeout:R=le.standard,TransitionComponent:Y=Ie,...M}=n,j={...n,orientation:y,collapsedSize:p},P=mt(j),D=ce(),J=Oe(),_=H.useRef(null),A=H.useRef(),k=typeof p=="number"?`${p}px`:p,z=y==="horizontal",$=z?"width":"height",F=H.useRef(null),de=De(o,F),N=s=>C=>{if(s){const v=F.current;C===void 0?s(v):s(v,C)}},Q=()=>_.current?_.current[z?"clientWidth":"clientHeight"]:0,ue=N((s,C)=>{_.current&&z&&(_.current.style.position="absolute"),s.style[$]=k,g&&g(s,C)}),he=N((s,C)=>{const v=Q();_.current&&z&&(_.current.style.position="");const{duration:I,easing:V}=te({style:T,timeout:R,easing:m},{mode:"enter"});if(R==="auto"){const Z=D.transitions.getAutoHeightDuration(v);s.style.transitionDuration=`${Z}ms`,A.current=Z}else s.style.transitionDuration=typeof I=="string"?I:`${I}ms`;s.style[$]=`${v}px`,s.style.transitionTimingFunction=V,b&&b(s,C)}),me=N((s,C)=>{s.style[$]="auto",S&&S(s,C)}),fe=N(s=>{s.style[$]=`${Q()}px`,w&&w(s)}),ge=N(r),ye=N(s=>{const C=Q(),{duration:v,easing:I}=te({style:T,timeout:R,easing:m},{mode:"exit"});if(R==="auto"){const V=D.transitions.getAutoHeightDuration(C);s.style.transitionDuration=`${V}ms`,A.current=V}else s.style.transitionDuration=typeof v=="string"?v:`${v}ms`;s.style[$]=k,s.style.transitionTimingFunction=I,l&&l(s)}),Ce=s=>{R==="auto"&&J.start(A.current||0,s),c&&c(F.current,s)};return f.jsx(Y,{in:h,onEnter:ue,onEntered:me,onEntering:he,onExit:fe,onExited:ge,onExiting:ye,addEndListener:Ce,nodeRef:F,timeout:R==="auto"?null:R,...M,children:(s,{ownerState:C,...v})=>f.jsx(ft,{as:a,className:X(P.root,d,{entered:P.entered,exited:!h&&k==="0px"&&P.hidden}[s]),style:{[z?"minWidth":"minHeight"]:k,...T},ref:de,ownerState:{...j,state:s},...v,children:f.jsx(gt,{ownerState:{...j,state:s},className:P.wrapper,ref:_,children:f.jsx(yt,{ownerState:{...j,state:s},className:P.wrapperInner,children:i})})})})});ne&&(ne.muiSupportAuto=!0);export{_t as C,Et as a,ne as b,Pt as c,Ve as d,et as e,Le as f,pe as g,We as h,Xe as i,Ze as j,Rt as k,tt as l,Je as m,Mt as n,pt as o,W as p,st as q,Ye as r,Tt as s,E as t,zt as u,ht as v,Qe as w};