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 • 4.83 kB
JavaScript
import"./main-OCJB5534.js";import{Bi as ym,Di as wf,Dr as lo,Dt as Qe,Gn as dT,In as by,It as Sn,Kr as oT,Lt as Sy,P as HT,Pi as xf,Pn as bm,Qr as qC,Rn as co,T as Ee,Xt as Uy,_ as Cf,ei as qT,er as gT,in as Wa,mn as YQ,pt as Nf,rn as WC,s as $y,ur as iT,vr as jy,w as Eb,wi as vt,wr as lc}from"./chunk-CHqDEyfr.js";import"./chunk-DolM25Wu.js";import"./chunk-CPClUPec.js";import"./chunk-CyniViPG.js";import"./chunk-DjVJBOYc.js";import"./chunk-CWEwaFv9.js";import{o as z,s as zt}from"./chunk-CyaMV1f5.js";import"./chunk-BM0xjj91.js";import{C as xn,a as He,i as Gn,y as on}from"./chunk-B_FU7ynV.js";import{n as wt,r as yt}from"./chunk-CGgWGJ3E.js";import"./chunk-CFyh5uM7.js";import{i as Qt}from"./chunk-CLjqwtZV.js";import{i as ze,t as Oe}from"./chunk-BYtjyP-K.js";import"./chunk-DxgAwx0L.js";import"./chunk-CaLi_qYn2.js";import{n as Yt}from"./chunk-C73tB7I62.js";import"./chunk-CARSOUZ02.js";import"./chunk-BTZfv3-Q.js";import{t as D}from"./chunk-BXYGriq12.js";var J=[`searchInput`];var X=(n,s)=>s.label;function Y(n,s){if(n&1){let e=dT();Wa(0,`div`,7),Sy(`click`,function(){let t=ym(e).$implicit;return bm(gT().execute(t))}),Wa(1,`span`,8),HT(2),wf(),Wa(3,`kbd`,9),HT(4),wf()()}if(n&2){let e=s.$implicit,i=s.$index;vt(`p3xr-command-palette-item-active`,i===gT().selectedIndex),Sn(2),jy(e.description),Sn(2),jy(e.label)}}function Z(n,s){if(n&1&&(Wa(0,`div`,6),HT(1),wf()),n&2){let e=gT();Sn(),Nf(` `,e.strings().label?.noResults,` `)}}var he=(()=>{class n{dialogRef;i18n;shortcutsService;searchInput;search=``;selectedIndex=0;strings;allItems=[];filtered=[];constructor(e,i,t){this.dialogRef=e,this.i18n=i,this.shortcutsService=t,this.strings=this.i18n.strings}ngOnInit(){let e=this.strings(),i=new Set;this.allItems=[];for(let t of this.shortcutsService.getShortcuts())i.has(t.descriptionKey)||(i.add(t.descriptionKey),this.allItems.push({label:t.label,description:e?.label?.[t.descriptionKey]||t.descriptionKey,shortcut:t}));this.filtered=[...this.allItems]}ngAfterViewInit(){setTimeout(()=>this.searchInput?.nativeElement?.focus(),50)}onKeydown(e){e.key===`ArrowDown`?(e.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.filtered.length-1)):e.key===`ArrowUp`?(e.preventDefault(),this.selectedIndex=Math.max(this.selectedIndex-1,0)):e.key===`Enter`?(e.preventDefault(),this.filtered[this.selectedIndex]&&this.execute(this.filtered[this.selectedIndex])):e.key===`Escape`?this.dialogRef.close():this.filter()}filter(){let e=this.search.toLowerCase().trim();this.filtered=e?this.allItems.filter(i=>i.description.toLowerCase().includes(e)||i.label.toLowerCase().includes(e)):[...this.allItems],this.selectedIndex=0}execute(e){this.dialogRef.close(),e.shortcut.action()}static ɵfac=function(i){return new(i||n)(Qe(z),Qe(YQ),Qe(D))};static ɵcmp=Ee({type:n,selectors:[[`p3xr-command-palette-dialog`]],viewQuery:function(i,t){if(i&1&&lc(J,5),i&2){let l;Cf(l=xf())&&(t.searchInput=l.first)}},decls:10,vars:3,consts:[[`searchInput`,``],[1,`p3xr-command-palette`],[1,`p3xr-command-palette-search`],[`matInput`,``,`autocomplete`,`off`,3,`ngModelChange`,`keydown`,`ngModel`,`placeholder`],[1,`p3xr-command-palette-list`],[1,`p3xr-command-palette-item`,3,`p3xr-command-palette-item-active`],[1,`p3xr-command-palette-empty`],[1,`p3xr-command-palette-item`,3,`click`],[1,`p3xr-command-palette-desc`],[1,`p3xr-kbd`]],template:function(i,t){if(i&1){let l=dT();Wa(0,`div`,1)(1,`div`,2)(2,`mat-icon`),HT(3,`search`),wf(),Wa(4,`input`,3,0),$y(`ngModelChange`,function(c){return ym(l),qT(t.search,c)||(t.search=c),bm(c)}),Sy(`keydown`,function(c){return t.onKeydown(c)}),wf(),WC(),wf(),Wa(6,`div`,4),oT(7,Y,5,4,`div`,5,X),co(9,Z,2,1,`div`,6),wf()()}i&2&&(Sn(4),Uy(`ngModel`,t.search),by(`placeholder`,t.strings().label?.commandPalette),qC(),Sn(3),iT(t.filtered),Sn(2),lo(t.filtered.length===0?9:-1))},dependencies:[Eb,Gn,He,xn,on,zt,Yt,yt,wt,Oe,ze,Qt],styles:[`.p3xr-command-palette[_ngcontent-%COMP%]{width:100%;min-width:400px}.p3xr-command-palette-search[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--%NS%p3xr-list-border, rgba(0,0,0,.12))}.p3xr-command-palette-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:inherit;font-size:16px;font-family:inherit}.p3xr-command-palette-list[_ngcontent-%COMP%]{max-height:300px;overflow-y:auto}.p3xr-command-palette-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;cursor:pointer}.p3xr-command-palette-item[_ngcontent-%COMP%]:hover, .p3xr-command-palette-item-active[_ngcontent-%COMP%]{background:var(--%NS%p3xr-hover-bg, rgba(0,0,0,.04))}.p3xr-command-palette-empty[_ngcontent-%COMP%]{padding:16px;text-align:center;opacity:.5}`],changeDetection:1})}return n})();export{he as CommandPaletteDialogComponent};