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 • 1.83 kB
JavaScript
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{k as t,lt as n,t as r}from"./Box-DSXpVc0K.js";import{n as i,o as a}from"./i18n.store-ZJjZbIIr.js";import{c as o,n as s,r as c,t as l}from"./KeyboardArrowDown-D_jWdzEv.js";import{t as u}from"./KeyboardArrowUp-xCWEyXLK.js";var d=e(a()),f=n(),p=0;function m({title:e,accordionKey:n,collapsible:a=!0,actions:m,children:h}){let g=i(e=>e.strings),_=t(),[v]=(0,d.useState)(()=>n||String(++p)),y=`p3xr-accordion-extended-${v}`,[b,x]=(0,d.useState)(()=>{if(!a)return!0;try{let e=localStorage.getItem(y);return e===null||e===`true`}catch{return!0}});(0,d.useEffect)(()=>{if(!a){x(!0);return}try{localStorage.setItem(y,String(b))}catch{}},[b,y,a]);let S=()=>x(e=>!e);return(0,f.jsxs)(r,{sx:{mb:0},children:[(0,f.jsx)(s,{variant:`dense`,disableGutters:!0,sx:{height:48,minHeight:`48px !important`,maxHeight:48,fontSize:20,fontWeight:400,bgcolor:_.p3xr.accordionBg,color:_.p3xr.accordionColor,px:0,py:0,borderRadius:b?`4px 4px 0 0`:`4px`,boxShadow:b?`0 1px 1px rgba(0,0,0,0.3)`:`0 1px 1px rgba(0,0,0,0.4)`},children:(0,f.jsxs)(r,{sx:{display:`flex`,alignItems:`center`,width:`100%`,height:48,pr:`4px`,pl:`16px`,boxSizing:`border-box`},children:[(0,f.jsx)(r,{component:`span`,onClick:a?S:void 0,sx:{flex:1,cursor:a?`pointer`:`default`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),m&&(0,f.jsx)(r,{sx:{display:`flex`,alignItems:`center`},children:m}),a&&(0,f.jsx)(c,{title:b?g?.intention?.collapse:g?.intention?.extend,placement:`top`,children:(0,f.jsx)(o,{onClick:S,sx:{flexShrink:0,width:40,height:40,p:0,color:`inherit`},children:b?(0,f.jsx)(u,{}):(0,f.jsx)(l,{})})})]})}),(0,f.jsx)(r,{sx:{border:1,borderColor:_.p3xr.accordionBg,borderRadius:`0 0 4px 4px`,borderTop:0,bgcolor:`background.paper`,display:b?`block`:`none`},children:h})]})}export{m as t};