UNPKG

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

3 lines (2 loc) • 8.05 kB
import{b as te}from"./chunk-AN7C4JCR.js";import{c as oe,d as ae}from"./chunk-5ONGW7JF.js";import{d as $,i as H,j as N}from"./chunk-AN3YSLKY.js";import"./chunk-6J2GCUHA.js";import{b as K,f as Q,j as U,v as X}from"./chunk-ICUC3WIE.js";import{c as J,d as ie,e as ne}from"./chunk-VMTBY4VN.js";import{b as Y,c as Z}from"./chunk-HFDIHHHN.js";import{a as B,d as q,e as G,f as O,g as W}from"./chunk-7JNYLOAK.js";import{$a as v,Bb as p,Cb as C,Da as x,Db as g,Hb as E,Ia as w,Ib as F,Jb as R,Ld as P,Nd as V,Pd as L,Rd as ee,Xa as _,Ya as b,Zb as j,_a as I,ab as y,ba as S,bb as T,ca as D,cb as o,db as l,eb as M,jb as A,lb as f,nb as u,oc as z,xa as r}from"./chunk-KQUCMSSK.js";import"./chunk-FCVD6SGJ.js";import"./chunk-O7S4L63H.js";var re=(i,d)=>d.key;function le(i,d){if(i&1&&(o(0,"div",6),p(1),l()),i&2){let e,t=u();r(),g(" ",(e=t.strings().label)==null||e.cheatsheet==null?null:e.cheatsheet.subtitle," ")}}function se(i,d){if(i&1&&(o(0,"div",7),p(1),l()),i&2){let e,t=u();r(),g(" ",(e=t.strings().label)==null||e.cheatsheet==null?null:e.cheatsheet.footerHint," ")}}function pe(i,d){if(i&1&&(o(0,"div",19),p(1),l()),i&2){let e=u().$implicit;r(),C(e.description)}}function ce(i,d){if(i&1){let e=A();o(0,"button",22),f("click",function(){let n=S(e).$implicit,s=u(2);return D(s.pick(n))}),p(1),l()}if(i&2){let e=d.$implicit;r(),g(" ",e," ")}}function me(i,d){if(i&1&&(o(0,"div",13)(1,"div",18),p(2),l(),_(3,pe,2,1,"div",19),o(4,"div",20),v(5,ce,2,1,"button",21,I),l()()),i&2){let e=d.$implicit,t=u();r(2),C(e.name),r(),b(e.description?3:-1),r(2),y(t.filteredPrompts(e.prompts))}}function de(i,d){if(i&1&&(o(0,"div",14),p(1),l()),i&2){let e,t=u();r(),g(" ",(e=t.strings().label)==null||e.cheatsheet==null?null:e.cheatsheet.empty," ")}}var Ve=(()=>{class i{i18n;state;cdr;dialogRef;strings;filter="";constructor(e,t,n,s){this.i18n=e,this.state=t,this.cdr=n,this.dialogRef=s,this.strings=this.i18n.strings}visibleGroups(){let e=this.strings()?.label?.cheatsheet?.groups;if(!e)return[];let t=(this.state.modules()||[]).map(h=>(h?.name||"").toLowerCase()),n=h=>{let c=this.state.redisVersion?.();return c?.isAtLeast?c.isAtLeast(h,0):!1},s=this.state.info()?.server?.redis_mode==="cluster",m=[],a=(h,c)=>{!c||!Array.isArray(c.prompts)||c.prompts.length===0||m.push({key:h,name:c.name,description:c.description,prompts:c.prompts})};return a("diagnostics",e.diagnostics),a("keys",e.keys),a("dataTypes",e.dataTypes),(t.includes("rejson")||t.includes("rejson-rl")||t.includes("json"))&&a("json",e.json),(t.includes("search")||t.includes("searchlight"))&&a("search",e.search),t.includes("timeseries")&&a("timeseries",e.timeseries),t.includes("bf")&&a("bloom",e.bloom),n(8)&&(a("vectorSet",e.vectorSet),a("redis8",e.redis8)),a("scripting",e.scripting),s&&a("cluster",e.cluster),n(6)&&a("acl",e.acl),a("qna",e.qna),a("translate",e.translate),m}filteredPrompts(e){let t=this.filter.trim().toLowerCase();return t?e.filter(n=>n.toLowerCase().includes(t)):e}emptyResults(){return this.visibleGroups().every(e=>this.filteredPrompts(e.prompts).length===0)}pick(e){this.dialogRef.close("ai: "+e)}openOfficialDocs(){window.open("https://redis.io/docs/latest/commands/","_blank")}close(){this.dialogRef.close(void 0)}static \u0275fac=function(t){return new(t||i)(x(ee),x(te),x(j),x(B))};static \u0275cmp=w({type:i,selectors:[["p3xr-ai-cheatsheet-dialog"]],decls:32,vars:8,consts:[[1,"p3xr-dialog-toolbar","p3xr-mat-layout-strong"],["mat-dialog-title","",1,"p3xr-dialog-title"],[2,"flex","1 1 auto"],["mat-icon-button","","type","button",3,"click"],[1,"p3xr-dialog-content","p3xr-cheatsheet-content"],[1,"p3xr-cheatsheet-sticky"],[1,"p3xr-cheatsheet-sub"],[1,"p3xr-cheatsheet-tip"],[1,"p3xr-cheatsheet-search"],["subscriptSizing","dynamic","appearance","fill",2,"width","100%"],["matPrefix",""],["matInput","",3,"ngModelChange","keydown","ngModel","placeholder"],[1,"p3xr-cheatsheet-groups"],[1,"p3xr-cheatsheet-group"],[1,"p3xr-cheatsheet-empty"],[1,"p3xr-dialog-actions","p3xr-cheatsheet-footer"],["mat-raised-button","","type","button",1,"btn-primary",3,"click"],["mat-flat-button","","type","button",1,"btn-primary",3,"click"],[1,"p3xr-cheatsheet-group-name"],[1,"p3xr-cheatsheet-group-desc"],[1,"p3xr-cheatsheet-prompts"],["type","button",1,"p3xr-cheatsheet-prompt"],["type","button",1,"p3xr-cheatsheet-prompt",3,"click"]],template:function(t,n){if(t&1&&(o(0,"mat-toolbar",0)(1,"span",1),p(2),l(),M(3,"span",2),o(4,"button",3),f("click",function(){return n.close()}),o(5,"mat-icon"),p(6,"close"),l()()(),o(7,"mat-dialog-content",4)(8,"div",5),_(9,le,2,1,"div",6),_(10,se,2,1,"div",7),o(11,"div",8)(12,"mat-form-field",9)(13,"mat-icon",10),p(14,"search"),l(),o(15,"input",11),R("ngModelChange",function(m){return F(n.filter,m)||(n.filter=m),m}),f("keydown",function(m){return m.stopPropagation()}),l()()()(),o(16,"div",12),v(17,me,7,2,"div",13,re),_(19,de,2,1,"div",14),l()(),o(20,"mat-dialog-actions",15),M(21,"span",2),o(22,"button",16),f("click",function(){return n.openOfficialDocs()}),o(23,"mat-icon"),p(24,"menu_book"),l(),o(25,"span"),p(26),l()(),o(27,"button",17),f("click",function(){return n.close()}),o(28,"mat-icon"),p(29,"close"),l(),o(30,"span"),p(31),l()()()),t&2){let s,m,a,h,c,k;r(2),g(" ",(s=n.strings().label)==null||s.cheatsheet==null?null:s.cheatsheet.title," "),r(7),b(!((m=n.strings().label)==null||m.cheatsheet==null)&&m.cheatsheet.subtitle?9:-1),r(),b(!((a=n.strings().label)==null||a.cheatsheet==null)&&a.cheatsheet.footerHint?10:-1),r(5),E("ngModel",n.filter),T("placeholder",((h=n.strings().label)==null||h.cheatsheet==null?null:h.cheatsheet.searchPlaceholder)??""),r(2),y(n.visibleGroups()),r(2),b(n.emptyResults()?19:-1),r(7),C((c=n.strings().label)==null||c.cheatsheet==null?null:c.cheatsheet.openOfficialDocs),r(5),C((k=n.strings().intention)==null?null:k.close)}},dependencies:[z,X,K,Q,U,W,q,O,G,N,H,$,ae,oe,L,V,P,Z,Y,ne,ie,J],styles:[`.p3xr-cheatsheet-content.mat-mdc-dialog-content{padding:0!important}.p3xr-cheatsheet-sticky{position:sticky;top:0;z-index:2;background:var(--mat-app-background-color, inherit);border-bottom:1px solid var(--p3xr-content-border-color, rgba(255, 255, 255, .08));padding:12px 16px}.p3xr-cheatsheet-sub,.p3xr-cheatsheet-tip{font-size:13px;opacity:.8;line-height:1.4;padding-bottom:4px}.p3xr-cheatsheet-search{margin:0;padding:4px 0 0}.p3xr-cheatsheet-search .mat-mdc-form-field-subscript-wrapper,.p3xr-cheatsheet-search .mat-mdc-form-field-bottom-align{display:none!important;height:0!important;min-height:0!important}.p3xr-cheatsheet-search .mat-mdc-text-field-wrapper,.p3xr-cheatsheet-search .mat-mdc-form-field{margin:0!important}.p3xr-cheatsheet-groups{padding:12px 16px}.p3xr-cheatsheet-group:first-child .p3xr-cheatsheet-group-name{margin-top:0}.p3xr-cheatsheet-groups{padding:0 16px 16px}.p3xr-cheatsheet-group{margin-bottom:18px}.p3xr-cheatsheet-group-name{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;margin-top:6px;margin-bottom:4px;opacity:.85}.p3xr-cheatsheet-group-desc{font-size:12px;opacity:.65;margin-bottom:8px}.p3xr-cheatsheet-prompts{display:flex;flex-direction:column;gap:4px}.p3xr-cheatsheet-prompt{display:block;width:100%;text-align:left;font-family:Roboto Mono,monospace;font-size:12px;line-height:1.5;padding:8px 12px;border:1px solid var(--p3xr-content-border-color, rgba(127, 127, 127, .3));border-radius:4px;background:transparent;color:inherit;cursor:pointer;white-space:normal;word-break:break-word;overflow-wrap:anywhere;transition:background .1s ease,border-color .1s ease}.p3xr-cheatsheet-prompt:hover{background:var(--p3xr-accordion-bg, rgba(127, 127, 127, .12));border-color:var(--mat-sys-primary, currentColor)}.p3xr-cheatsheet-prompt:focus-visible{outline:2px solid var(--mat-sys-primary, currentColor);outline-offset:-1px}.p3xr-cheatsheet-empty{padding:24px;text-align:center;opacity:.6;font-size:13px}.p3xr-cheatsheet-footer{padding:10px 16px!important;min-height:auto!important}.p3xr-cheatsheet-footer-hint{font-size:11px;opacity:.7;line-height:1.4} `],encapsulation:2,changeDetection:0})}return i})();export{Ve as AiCheatsheetDialogComponent};