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
2 lines (1 loc) • 3.31 kB
JavaScript
import{a as C}from"./chunk-MU5JSBF3.js";import"./chunk-NBRXTOBF.js";import{b as B,c as N,d as G,e as L}from"./chunk-53CQV6LZ.js";import{b as P,c as q}from"./chunk-4GIODJCK.js";import{a as A,b as I,d as E,e as R,f as O,g as Q}from"./chunk-PFG3GPGC.js";import{Bb as a,Cb as f,Da as p,Db as V,Ia as h,Ld as J,Nd as S,Pd as k,Rd as F,Xa as x,Ya as g,ba as u,bb as d,ca as _,cb as o,db as l,eb as T,jb as v,lb as m,nb as c,oc as y,rb as M,sb as j,tb as D,xa as s}from"./chunk-MHKTEXY5.js";import"./chunk-ENGD2CVB.js";import"./chunk-O7S4L63H.js";function z(i,w){if(i&1){let t=v();o(0,"button",7),m("click",function(){u(t);let n=c();return _(n.expandAll())}),o(1,"mat-icon"),a(2,"keyboard_arrow_down"),l()(),o(3,"button",7),m("click",function(){u(t);let n=c();return _(n.collapseAll())}),o(4,"mat-icon"),a(5,"keyboard_arrow_up"),l()()}if(i&2){let t,e,n=c();d("matTooltip",(t=n.strings().page)==null||t.treeControls==null?null:t.treeControls.expandAll),s(3),d("matTooltip",(e=n.strings().page)==null||e.treeControls==null?null:e.treeControls.collapseAll)}}function H(i,w){if(i&1&&T(0,"p3xr-json-tree",4),i&2){let t,e=c();d("data",e.obj)("label",(t=e.strings().label)==null?null:t.tree)("expanded",e.treeExpanded)}}function K(i,w){if(i&1&&(o(0,"div"),a(1),l()),i&2){let t,e=c();s(),f((t=e.strings().label)==null?null:t.jsonViewNotParsable)}}var st=(()=>{class i{dialogRef;data;i18n;jsonTree;obj;isJson=!1;treeExpanded=!0;strings;constructor(t,e,n){this.dialogRef=t,this.data=e,this.i18n=n,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=!1}}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(e){return new(e||i)(p(A),p(I),p(F))};static \u0275cmp=h({type:i,selectors:[["p3xr-json-view-dialog"]],viewQuery:function(e,n){if(e&1&&M(C,5),e&2){let r;j(r=D())&&(n.jsonTree=r.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(e,n){if(e&1&&(o(0,"mat-toolbar",0)(1,"span",1)(2,"mat-icon"),a(3,"account_tree"),l(),o(4,"span"),a(5),l()(),x(6,z,6,2),o(7,"button",2),m("click",function(){return n.close()}),o(8,"mat-icon"),a(9,"close"),l()()(),o(10,"mat-dialog-content",3),x(11,H,1,3,"p3xr-json-tree",4)(12,K,2,1,"div"),l(),o(13,"mat-dialog-actions",5)(14,"button",6),m("click",function(){return n.close()}),o(15,"mat-icon"),a(16,"close"),l(),a(17),l()()),e&2){let r,b;s(5),f((r=n.strings().intention)==null?null:r.jsonViewShow),s(),g(n.isJson?6:-1),s(5),g(n.isJson?11:12),s(6),V(" ",(b=n.strings().intention)==null?null:b.close," ")}},dependencies:[y,Q,E,O,R,k,S,J,q,P,L,G,N,B,C],styles:[".p3xr-json-view-content[_ngcontent-%COMP%]{min-height:200px;max-height:70vh;overflow:auto}"]})}return i})();export{st as JsonViewDialogComponent};