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

1 lines • 3.15 kB
import {W as Wt}from'./chunk-Dqaenx7A.js';import {X as Xe,cV as z$1,d1 as Ue,f as fQ,_ as _e,m as mb,cW as zt,cX as jt,cY as Vt,cZ as Nt,e as aY,aK as iY,g as _A,y as yt,w as wt,d as ae,s as se,i as Qt,j as gt,B as Ba,I as IS,v as vf,n as no,k as bv,c as In,R as Rv,r as ro,t as If,a$ as rc,b0 as Df,b1 as Ef,h as hv,J as JT,p as pv,x as YT,z as fm,A as pm}from'./chunk-BwlFOdbx.js';import'./main-HNF44SV3.js';function L(i,w){if(i&1){let t=YT();Ba(0,"button",7),bv("click",function(){fm(t);let e=JT();return pm(e.expandAll())}),Ba(1,"mat-icon"),IS(2,"keyboard_arrow_down"),vf()(),Ba(3,"button",7),bv("click",function(){fm(t);let e=JT();return pm(e.collapseAll())}),Ba(4,"mat-icon"),IS(5,"keyboard_arrow_up"),vf()();}if(i&2){let t=JT();pv("matTooltip",t.strings().page?.treeControls?.expandAll),In(3),pv("matTooltip",t.strings().page?.treeControls?.collapseAll);}}function z(i,w){if(i&1&&hv(0,"p3xr-json-tree",4),i&2){let t=JT();pv("data",t.obj)("label",t.strings().label?.tree)("expanded",t.treeExpanded);}}function H(i,w){if(i&1&&(Ba(0,"div"),IS(1),vf()),i&2){let t=JT();In(),Rv(t.strings().label?.jsonViewNotParsable);}}var rt=(()=>{class i{dialogRef;data;i18n;jsonTree;obj;isJson=false;treeExpanded=true;strings;constructor(t,n,e){this.dialogRef=t,this.data=n,this.i18n=e,this.strings=this.i18n.strings;}ngOnInit(){try{this.obj=JSON.parse(this.data.value),this.isJson=!0;}catch(t){this.obj=void 0,this.isJson=false;}}expandAll(){this.jsonTree?.treeControl.expandAll();}collapseAll(){this.jsonTree?.treeControl.collapseAll();let t=this.jsonTree?.treeControl.dataNodes?.[0];t&&this.jsonTree.treeControl.expand(t);}close(){this.dialogRef.close();}static \u0275fac=function(n){return new(n||i)(Xe(z$1),Xe(Ue),Xe(fQ))};static \u0275cmp=_e({type:i,selectors:[["p3xr-json-view-dialog"]],viewQuery:function(n,e){if(n&1&&rc(Wt,5),n&2){let m;Df(m=Ef())&&(e.jsonTree=m.first);}},decls:18,vars:4,consts:[[1,"p3xr-dialog-toolbar","p3xr-mat-layout-strong"],["mat-dialog-title","",1,"p3xr-dialog-title","p3xr-dialog-title-with-icon"],["mat-icon-button","",3,"click"],[1,"p3xr-dialog-content","p3xr-dialog-content-mono","p3xr-json-view-content"],[3,"data","label","expanded"],[1,"p3xr-dialog-actions"],["mat-raised-button","","type","button",1,"btn-accent",3,"click"],["mat-icon-button","",3,"click","matTooltip"]],template:function(n,e){n&1&&(Ba(0,"mat-toolbar",0)(1,"span",1)(2,"mat-icon"),IS(3,"account_tree"),vf(),Ba(4,"span"),IS(5),vf()(),no(6,L,6,2),Ba(7,"button",2),bv("click",function(){return e.close()}),Ba(8,"mat-icon"),IS(9,"close"),vf()()(),Ba(10,"mat-dialog-content",3),no(11,z,1,3,"p3xr-json-tree",4)(12,H,2,1,"div"),vf(),Ba(13,"mat-dialog-actions",5)(14,"button",6),bv("click",function(){return e.close()}),Ba(15,"mat-icon"),IS(16,"close"),vf(),IS(17),vf()()),n&2&&(In(5),Rv(e.strings().intention?.jsonViewShow),In(),ro(e.isJson?6:-1),In(5),ro(e.isJson?11:12),In(6),If(" ",e.strings().intention?.close," "));},dependencies:[mb,zt,jt,Vt,Nt,aY,iY,_A,yt,wt,ae,se,Qt,gt,Wt],styles:[".p3xr-json-view-content[_ngcontent-%COMP%]{min-height:200px;max-height:70vh;overflow:auto}"],changeDetection:1})}return i})();export{rt as JsonViewDialogComponent};