p3x-redis-ui-material
Version:
💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity
1 lines • 11.3 kB
JavaScript
import{i as e}from"./chunk-DseTPa7n.js";import{B as t,C as n,D as r,Q as i,V as a,a as o,b as s,j as c,t as l,w as u,x as d,y as f,z as p}from"./Box-CXFf6N2h.js";import{o as m}from"./i18n.store-fGbhAfs-.js";import{c as h,n as g,v as _}from"./KeyboardArrowDown-Bd9MEjfK.js";import{t as v}from"./useMediaQuery-CYHKoU7e.js";import{b as y,d as b,l as x,u as S}from"./TextField-DJCDsXWr.js";import{t as C}from"./createSimplePaletteValueFilter-CS4iIFa3.js";import{t as w}from"./theme.store-Pi-gufNM.js";import{t as T}from"./Close-ChCm9mL2.js";var E=e(m(),1);function D(e){return t(`MuiAppBar`,e)}p(`MuiAppBar`,[`root`,`positionFixed`,`positionAbsolute`,`positionSticky`,`positionStatic`,`positionRelative`,`colorDefault`,`colorPrimary`,`colorSecondary`,`colorInherit`,`colorTransparent`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`]);var O=i(),k=e=>{let{color:t,position:r,classes:i}=e;return c({root:[`root`,`color${n(t)}`,`position${n(r)}`]},D,i)},A=(e,t)=>e?`${e.replace(`)`,``)}, ${t})`:t,j=u(y,{name:`MuiAppBar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`position${n(r.position)}`],t[`color${n(r.color)}`]]}})(d(({theme:e})=>({display:`flex`,flexDirection:`column`,width:`100%`,boxSizing:`border-box`,flexShrink:0,variants:[{props:{position:`fixed`},style:{position:`fixed`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0,"@media print":{position:`absolute`}}},{props:{position:`absolute`},style:{position:`absolute`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0}},{props:{position:`sticky`},style:{position:`sticky`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0}},{props:{position:`static`},style:{position:`static`}},{props:{position:`relative`},style:{position:`relative`}},{props:{color:`inherit`},style:{"--AppBar-color":`inherit`,color:`var(--AppBar-color)`}},{props:{color:`default`},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles(`dark`,{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(C([`contrastText`])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:e=>e.enableColorOnDark===!0&&![`inherit`,`transparent`].includes(e.color),style:{backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`}},{props:e=>e.enableColorOnDark===!1&&![`inherit`,`transparent`].includes(e.color),style:{backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`,...e.applyStyles(`dark`,{backgroundColor:e.vars?A(e.vars.palette.AppBar.darkBg,`var(--AppBar-background)`):null,color:e.vars?A(e.vars.palette.AppBar.darkColor,`var(--AppBar-color)`):null})}},{props:{color:`transparent`},style:{"--AppBar-background":`transparent`,"--AppBar-color":`inherit`,backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`,...e.applyStyles(`dark`,{backgroundImage:`none`})}}]}))),M=E.forwardRef(function(e,t){let n=s({props:e,name:`MuiAppBar`}),{className:r,color:i=`primary`,enableColorOnDark:o=!1,position:c=`fixed`,...l}=n,u={...n,color:i,position:c,enableColorOnDark:o};return(0,O.jsx)(j,{square:!0,component:`header`,ownerState:u,elevation:4,className:a(k(u).root,r,c===`fixed`&&`mui-fixed`),ref:t,...l})});function N(e){return t(`MuiDialog`,e)}p(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]);var P=E.createContext({}),F=u(S,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),I=e=>{let{classes:t,scroll:r,maxWidth:i,fullWidth:a,fullScreen:o}=e;return c({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${n(r)}`],paper:[`paper`,`paperWidth${n(String(i))}`,a&&`paperFullWidth`,o&&`paperFullScreen`]},N,t)},L=u(x,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),R=u(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.container,t[`scroll${n(r.scroll)}`]]}})({height:`100%`,"@media print":{height:`auto`},outline:0,variants:[{props:{scroll:`paper`},style:{display:`flex`,justifyContent:`center`,alignItems:`center`}},{props:{scroll:`body`},style:{overflowY:`auto`,overflowX:`hidden`,textAlign:`center`,"&::after":{content:`""`,display:`inline-block`,verticalAlign:`middle`,height:`100%`,width:`0`}}}]}),z=u(y,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.paper,t[`paperWidth${n(String(r.maxWidth))}`],r.fullWidth&&t.paperFullWidth,r.fullScreen&&t.paperFullScreen]}})(d(({theme:e})=>({margin:32,position:`relative`,overflowY:`auto`,"@media print":{overflowY:`visible`,boxShadow:`none`},variants:[{props:{scroll:`paper`},style:{display:`flex`,flexDirection:`column`,maxHeight:`calc(100% - 64px)`}},{props:{scroll:`body`},style:{display:`inline-block`,verticalAlign:`middle`,textAlign:`initial`}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:`calc(100% - 64px)`}},{props:{maxWidth:`xs`},style:{maxWidth:e.breakpoints.unit===`px`?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`}},{props:{maxWidth:`xs`,scroll:`body`},style:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:`calc(100% - 64px)`}}},...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`}})),...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t,scroll:`body`},style:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:`calc(100% - 64px)`}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:`calc(100% - 64px)`}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:`100%`,maxWidth:`100%`,height:`100%`,maxHeight:`none`,borderRadius:0}},{props:({ownerState:e})=>e.fullScreen&&e.scroll===`body`,style:{margin:0,maxWidth:`100%`}}]}))),B=E.forwardRef(function(e,t){let n=s({props:e,name:`MuiDialog`}),i=r(),c={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":u,"aria-modal":d=!0,children:f,className:p,fullScreen:m=!1,fullWidth:h=!1,maxWidth:g=`sm`,onClick:v,onClose:x,open:S,PaperComponent:C=y,role:w=`dialog`,scroll:T=`paper`,slots:D={},slotProps:k={},transitionDuration:A=c,...j}=n,M={...n,fullScreen:m,fullWidth:h,maxWidth:g,scroll:T},N=I(M),B=E.useRef(),V=e=>{B.current=e.target===e.currentTarget},H=e=>{v&&v(e),B.current&&(B.current=null,x&&x(e,`backdropClick`))},U=_(u),W=E.useMemo(()=>({titleId:U}),[U]),G={slots:D,slotProps:k},[K,q]=o(`root`,{elementType:L,shouldForwardComponentProp:!0,externalForwardedProps:G,ownerState:M,className:a(N.root,p),ref:t}),[J,Y]=o(`backdrop`,{elementType:F,shouldForwardComponentProp:!0,externalForwardedProps:G,ownerState:M,className:N.backdrop}),[X,Z]=o(`paper`,{elementType:z,shouldForwardComponentProp:!0,externalForwardedProps:G,ownerState:M,className:N.paper}),[Q,$]=o(`container`,{elementType:R,externalForwardedProps:G,ownerState:M,className:N.container}),[ee,te]=o(`transition`,{elementType:b,externalForwardedProps:G,ownerState:M,additionalProps:{appear:!0,in:S,timeout:A,role:`presentation`}});return(0,O.jsx)(K,{closeAfterTransition:!0,slots:{backdrop:J},slotProps:{backdrop:{transitionDuration:A,...Y}},onClose:x,open:S,onClick:H,...q,...j,children:(0,O.jsx)(ee,{...te,children:(0,O.jsx)(Q,{onMouseDown:V,...$,children:(0,O.jsx)(X,{as:C,elevation:24,role:w,"aria-describedby":l,"aria-labelledby":U,"aria-modal":d,...Z,children:(0,O.jsx)(P.Provider,{value:W,children:f})})})})})});function V(e){return t(`MuiDialogActions`,e)}p(`MuiDialogActions`,[`root`,`spacing`]);var H=e=>{let{classes:t,disableSpacing:n}=e;return c({root:[`root`,!n&&`spacing`]},V,t)},U=u(`div`,{name:`MuiDialogActions`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:`flex`,alignItems:`center`,padding:8,justifyContent:`flex-end`,flex:`0 0 auto`,variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),W=E.forwardRef(function(e,t){let n=s({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...o}=n,c={...n,disableSpacing:i};return(0,O.jsx)(U,{className:a(H(c).root,r),ownerState:c,ref:t,...o})});function G(e){return t(`MuiDialogContent`,e)}p(`MuiDialogContent`,[`root`,`dividers`]);var K=p(`MuiDialogTitle`,[`root`]),q=e=>{let{classes:t,dividers:n}=e;return c({root:[`root`,n&&`dividers`]},G,t)},J=u(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(d(({theme:e})=>({flex:`1 1 auto`,WebkitOverflowScrolling:`touch`,overflowY:`auto`,padding:`20px 24px`,variants:[{props:({ownerState:e})=>e.dividers,style:{padding:`16px 24px`,borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${K.root} + &`]:{paddingTop:0}}}]}))),Y=E.forwardRef(function(e,t){let n=s({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...o}=n,c={...n,dividers:i};return(0,O.jsx)(J,{className:a(q(c).root,r),ownerState:c,ref:t,...o})}),X=f((0,O.jsx)(`path`,{d:`M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z`}),`Cancel`);function Z({open:e,onClose:t,title:n,children:i,actions:a,headerActions:o,contentPadding:s=!0,height:c,fullScreenOnMobile:u=!0,width:d=`75vw`,maxWidth:f,scroll:p=`paper`}){let m=r(),_=w(e=>e.themeKey),y=v(`(max-width: 599px)`),b=u&&y,x=_===`matrix`?`#0a2e0d`:m.p3xr.accordionBg;return(0,O.jsxs)(B,{open:e,onClose:t,scroll:p,fullScreen:b,maxWidth:f??!1,slotProps:{paper:{sx:{...!b&&{width:d,maxWidth:d},...c&&!b&&{height:c},maxHeight:`calc(100vh - 64px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`}}},children:[(0,O.jsx)(M,{position:`static`,sx:{backgroundColor:`${m.p3xr.strongBg} !important`,backgroundImage:`none !important`,color:`rgba(255,255,255,0.87) !important`,flexShrink:0,boxShadow:`none`},children:(0,O.jsxs)(g,{variant:`dense`,disableGutters:!0,sx:{minHeight:`48px !important`,height:48,maxHeight:48,px:1},children:[(0,O.jsx)(l,{sx:{flex:`1 1 auto`,height:`100%`,display:`flex`,alignItems:`center`,lineHeight:`28px`,fontSize:16,fontWeight:500,pl:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n}),o,(0,O.jsx)(h,{color:`inherit`,onClick:t,size:`small`,sx:{m:0},children:(0,O.jsx)(T,{})})]})}),(0,O.jsx)(Y,{sx:{flex:`1 1 auto`,minHeight:0,overflow:`auto`,p:s?2:0,bgcolor:m.palette.background.paper,backgroundImage:`none`,color:m.palette.text.primary},children:i}),a&&(0,O.jsx)(W,{sx:{flexShrink:0,bgcolor:x,gap:1,px:1,py:1,justifyContent:`flex-end`,"& .MuiButton-root":{m:0,minWidth:0,whiteSpace:`nowrap`,pl:`10px`,pr:`8px`,letterSpacing:`0.01em`}},children:a})]})}export{M as i,X as n,B as r,Z as t};