UNPKG

@rero/sonar-ui

Version:

User interface for SONAR.

2 lines (1 loc) 12.7 kB
import{$a as re,Aa as N,Ba as c,Ca as ne,Cb as se,D as z,Da as V,Ea as ie,Eb as R,F as J,Fa as oe,G as I,Ga as h,Gc as ue,H as E,Ha as C,Hc as M,I as O,Ia as ae,Ic as ge,J as $,Ka as le,Kc as fe,Lb as _e,M as k,Mc as he,Nc as Ce,Oa as T,Pa as x,Pc as P,Q as H,Qa as Q,Qc as Te,Ra as K,X as p,_ as F,a as W,ad as ye,ba as U,bb as j,bd as be,c as o,ca as X,da as _,db as pe,fa as b,ia as v,id as xe,ja as B,jd as ve,ka as Y,kd as Be,ld as we,ma as Z,na as ee,oa as l,ob as ce,pa as u,qa as g,ra as L,rb as w,tb as D,va as A,vb as de,wa as S,xa as y,xc as me,ya as G,yb as q,za as te}from"./chunk-OW4VQFLY.js";var Ee=(e,n,t)=>({$implicit:e,last:n,index:t}),Oe=e=>({$implicit:e});function ke(e,n){e&1&&y(0)}function Fe(e,n){if(e&1&&_(0,ke,1,0,"ng-container",2),e&2){let t=c(),m=t.$implicit,r=t.$index,i=t.$count,d=c(3);l("ngTemplateOutlet",d.template())("ngTemplateOutletContext",pe(2,Ee,m,r===i-1,r))}}function Ae(e,n){if(e&1&&x(0),e&2){let t=c().$implicit;K(" ",t," ")}}function Se(e,n){if(e&1&&(u(0,"li"),v(1,Fe,1,6,"ng-container")(2,Ae,1,1),g()),e&2){let t=c(3);p(),B(t.template()?1:2)}}function Ne(e,n){if(e&1&&(u(0,"ul",1),Z(1,Se,3,1,"li",null,Y),g()),e&2){let t=c(2);p(),ee(t.field())}}function Ve(e,n){e&1&&y(0)}function Qe(e,n){if(e&1&&_(0,Ve,1,0,"ng-container",2),e&2){let t=c(3);l("ngTemplateOutlet",t.template())("ngTemplateOutletContext",j(2,Oe,t.field()))}}function je(e,n){if(e&1&&x(0),e&2){let t=c(3);K(" ",t.field()," ")}}function qe(e,n){if(e&1&&v(0,Qe,1,4,"ng-container")(1,je,1,1),e&2){let t=c(2);B(t.template()?0:1)}}function Re(e,n){if(e&1&&(u(0,"dl",0)(1,"dt"),x(2),g(),u(3,"dd"),v(4,Ne,3,0,"ul",1)(5,qe,2,1),g()()),e&2){let t=c();p(2),Q(t.label()),p(2),B(t.type()==="array"?4:5)}}var Ct=(()=>{let n=class n{constructor(){this.label=D(),this.field=D(),this.type=w(()=>this.getType()),this.templates=de(M),this.template=w(()=>{let m=this.templates().map(r=>r.getType()==="template"?r.template:null);return m.length>0?m[0]:null})}getType(){let m=this.field();return Array.isArray(m)?"array":typeof m}};n.\u0275fac=function(r){return new(r||n)},n.\u0275cmp=F({type:n,selectors:[["sonar-field-description"]],contentQueries:function(r,i,d){r&1&&ae(d,i.templates,M,4),r&2&&le()},inputs:{label:[1,"label"],field:[1,"field"]},decls:1,vars:1,consts:[[1,"metadata"],[1,"ui:list-none"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,i){r&1&&v(0,Re,6,2,"dl",0),r&2&&B(i.field()?0:-1)},dependencies:[R],encapsulation:2,changeDetection:0});let e=n;return e})();var De="\n .p-panel {\n display: block;\n border: 1px solid dt('panel.border.color');\n border-radius: dt('panel.border.radius');\n background: dt('panel.background');\n color: dt('panel.color');\n }\n\n .p-panel-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: dt('panel.header.padding');\n background: dt('panel.header.background');\n color: dt('panel.header.color');\n border-style: solid;\n border-width: dt('panel.header.border.width');\n border-color: dt('panel.header.border.color');\n border-radius: dt('panel.header.border.radius');\n }\n\n .p-panel-toggleable .p-panel-header {\n padding: dt('panel.toggleable.header.padding');\n }\n\n .p-panel-title {\n line-height: 1;\n font-weight: dt('panel.title.font.weight');\n }\n\n .p-panel-content-container {\n display: grid;\n grid-template-rows: 1fr;\n }\n\n .p-panel-content-wrapper {\n min-height: 0;\n }\n\n .p-panel-content {\n padding: dt('panel.content.padding');\n }\n\n .p-panel-footer {\n padding: dt('panel.footer.padding');\n }\n";var We=["header"],$e=["icons"],He=["content"],Le=["footer"],Ge=["headericons"],Ke=["contentWrapper"],ze=["*",[["p-header"]],[["p-footer"]]],Je=["*","p-header","p-footer"],Ue=e=>({$implicit:e});function Xe(e,n){if(e&1&&(u(0,"span",4),x(1),g()),e&2){let t=c(2);T(t.cx("title")),l("pBind",t.ptm("title")),b("id",t.id+"_header"),p(),Q(t._header)}}function Ye(e,n){e&1&&y(0)}function Ze(e,n){}function et(e,n){e&1&&_(0,Ze,0,0,"ng-template")}function tt(e,n){if(e&1&&(A(0),$(),L(1,"svg",12),S()),e&2){let t=c(5);p(),l("pBind",t.ptm("pcToggleButton.icon"))}}function nt(e,n){if(e&1&&(A(0),$(),L(1,"svg",13),S()),e&2){let t=c(5);p(),l("pBind",t.ptm("pcToggleButton.icon"))}}function it(e,n){if(e&1&&(A(0),_(1,tt,2,1,"ng-container",10)(2,nt,2,1,"ng-container",10),S()),e&2){let t=c(4);p(),l("ngIf",!t.collapsed),p(),l("ngIf",t.collapsed)}}function ot(e,n){}function at(e,n){e&1&&_(0,ot,0,0,"ng-template")}function lt(e,n){if(e&1&&_(0,it,3,2,"ng-container",10)(1,at,1,0,null,11),e&2){let t=c(3);l("ngIf",!t.headerIconsTemplate&&!t._headerIconsTemplate&&!(t.toggleButtonProps!=null&&t.toggleButtonProps.icon)),p(),l("ngTemplateOutlet",t.headerIconsTemplate||t._headerIconsTemplate)("ngTemplateOutletContext",j(3,Ue,t.collapsed))}}function rt(e,n){if(e&1){let t=G();u(0,"p-button",9),N("click",function(r){E(t);let i=c(2);return O(i.onIconClick(r))})("keydown",function(r){E(t);let i=c(2);return O(i.onKeyDown(r))}),_(1,lt,2,5,"ng-template",null,1,ce),g()}if(e&2){let t=c(2);l("text",!0)("rounded",!0)("styleClass",t.cx("pcToggleButton"))("buttonProps",t.toggleButtonProps)("pt",t.ptm("pcToggleButton"))("unstyled",t.unstyled()),b("id",t.id+"_header")("aria-label",t.buttonAriaLabel)("aria-controls",t.id+"_content")("aria-expanded",!t.collapsed)}}function pt(e,n){if(e&1){let t=G();u(0,"div",7),N("click",function(r){E(t);let i=c();return O(i.onHeaderClick(r))}),_(1,Xe,2,5,"span",6),V(2,1),_(3,Ye,1,0,"ng-container",5),u(4,"div",4),_(5,et,1,0,null,5)(6,rt,3,10,"p-button",8),g()()}if(e&2){let t=c();T(t.cx("header")),l("pBind",t.ptm("header")),b("id",t.id+"-titlebar")("data-p",t.dataP),p(),l("ngIf",t._header),p(2),l("ngTemplateOutlet",t.headerTemplate||t._headerTemplate),p(),T(t.cx("headerActions")),l("pBind",t.ptm("headerActions")),p(),l("ngTemplateOutlet",t.iconsTemplate||t._iconsTemplate),p(),l("ngIf",t.toggleable)}}function ct(e,n){e&1&&y(0)}function dt(e,n){e&1&&y(0)}function st(e,n){if(e&1&&(u(0,"div",4),V(1,2),_(2,dt,1,0,"ng-container",5),g()),e&2){let t=c();T(t.cx("footer")),l("pBind",t.ptm("footer")),p(2),l("ngTemplateOutlet",t.footerTemplate||t._footerTemplate)}}var _t={root:({instance:e})=>["p-panel p-component",{"p-panel-toggleable":e.toggleable,"p-panel-expanded":!e._collapsed&&e.toggleable,"p-panel-collapsed":e._collapsed&&e.toggleable}],header:"p-panel-header",title:"p-panel-title",headerActions:({instance:e})=>["p-panel-header-actions",{"p-panel-icons-start":e.iconPos==="start","p-panel-icons-end":e.iconPos==="end","p-panel-icons-center":e.iconPos==="center"}],pcToggleButton:"p-panel-toggle-button",contentContainer:"p-panel-content-container",contentWrapper:"p-panel-content-wrapper",content:"p-panel-content",footer:"p-panel-footer"},Me=(()=>{let n=class n extends fe{constructor(){super(...arguments);o(this,"name","panel");o(this,"style",De);o(this,"classes",_t)}};o(n,"\u0275fac",(()=>{let r;return function(d){return(r||(r=H(n)))(d||n)}})()),o(n,"\u0275prov",z({token:n,factory:n.\u0275fac}));let e=n;return e})();var Pe=new J("PANEL_INSTANCE"),zt=(()=>{var n;let t=class t extends Ce{constructor(){super(...arguments);o(this,"componentName","Panel");o(this,"$pcPanel",(n=I(Pe,{optional:!0,skipSelf:!0}))!=null?n:void 0);o(this,"_componentStyle",I(Me));o(this,"bindDirectiveInstance",I(P,{self:!0}));o(this,"id",me("pn_id_"));o(this,"toggleable");o(this,"_header");o(this,"_collapsed");o(this,"styleClass");o(this,"iconPos","end");o(this,"showHeader",!0);o(this,"toggler","icon");o(this,"transitionOptions","400ms cubic-bezier(0.86, 0, 0.07, 1)");o(this,"toggleButtonProps");o(this,"motionOptions",D(void 0));o(this,"computedMotionOptions",w(()=>W(W({},this.ptm("motion")),this.motionOptions())));o(this,"collapsedChange",new k);o(this,"onBeforeToggle",new k);o(this,"onAfterToggle",new k);o(this,"footerFacet");o(this,"headerTemplate");o(this,"iconsTemplate");o(this,"contentTemplate");o(this,"footerTemplate");o(this,"headerIconsTemplate");o(this,"_headerTemplate");o(this,"_iconsTemplate");o(this,"_contentTemplate");o(this,"_footerTemplate");o(this,"_headerIconsTemplate");o(this,"contentWrapperViewChild");o(this,"templates")}onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}get collapsed(){return this._collapsed}set collapsed(i){this._collapsed=i}get buttonAriaLabel(){return this._header}onHeaderClick(i){this.toggler==="header"&&this.toggle(i)}onIconClick(i){this.toggler==="icon"&&this.toggle(i)}toggle(i){this.onBeforeToggle.emit({originalEvent:i,collapsed:this.collapsed}),this.collapsed?this.expand():this.collapse(),i.preventDefault()}expand(){this._collapsed=!1,this.collapsedChange.emit(!1),this.updateTabIndex()}collapse(){this._collapsed=!0,this.collapsedChange.emit(!0),this.updateTabIndex()}getBlockableElement(){return this.el.nativeElement}updateTabIndex(){this.contentWrapperViewChild&&this.contentWrapperViewChild.nativeElement.querySelectorAll("input, button, select, a, textarea, [tabindex]").forEach(d=>{this.collapsed?d.setAttribute("tabindex","-1"):d.removeAttribute("tabindex")})}onKeyDown(i){(i.code==="Enter"||i.code==="Space")&&(this.toggle(i),i.preventDefault())}onToggleDone(i){this.onAfterToggle.emit({originalEvent:i,collapsed:this.collapsed})}onAfterContentInit(){this.templates.forEach(i=>{switch(i.getType()){case"header":this._headerTemplate=i.template;break;case"content":this._contentTemplate=i.template;break;case"footer":this._footerTemplate=i.template;break;case"icons":this._iconsTemplate=i.template;break;case"headericons":this._headerIconsTemplate=i.template;break;default:this._contentTemplate=i.template;break}})}get dataP(){return this.cn({toggleable:this.toggleable})}};o(t,"\u0275fac",(()=>{let i;return function(a){return(i||(i=H(t)))(a||t)}})()),o(t,"\u0275cmp",F({type:t,selectors:[["p-panel"]],contentQueries:function(d,a,f){if(d&1&&ie(f,ue,5)(f,We,4)(f,$e,4)(f,He,4)(f,Le,4)(f,Ge,4)(f,M,4),d&2){let s;h(s=C())&&(a.footerFacet=s.first),h(s=C())&&(a.headerTemplate=s.first),h(s=C())&&(a.iconsTemplate=s.first),h(s=C())&&(a.contentTemplate=s.first),h(s=C())&&(a.footerTemplate=s.first),h(s=C())&&(a.headerIconsTemplate=s.first),h(s=C())&&(a.templates=s)}},viewQuery:function(d,a){if(d&1&&oe(Ke,5),d&2){let f;h(f=C())&&(a.contentWrapperViewChild=f.first)}},hostVars:4,hostBindings:function(d,a){d&2&&(te("id",a.id),b("data-p",a.dataP),T(a.cn(a.cx("root"),a.styleClass)))},inputs:{id:"id",toggleable:[2,"toggleable","toggleable",q],_header:[0,"header","_header"],collapsed:[2,"collapsed","collapsed",q],styleClass:"styleClass",iconPos:"iconPos",showHeader:[2,"showHeader","showHeader",q],toggler:"toggler",transitionOptions:"transitionOptions",toggleButtonProps:"toggleButtonProps",motionOptions:[1,"motionOptions"]},outputs:{collapsedChange:"collapsedChange",onBeforeToggle:"onBeforeToggle",onAfterToggle:"onAfterToggle"},features:[re([Me,{provide:Pe,useExisting:t},{provide:he,useExisting:t}]),U([P]),X],ngContentSelectors:Je,decls:8,vars:18,consts:[["contentWrapper",""],["icon",""],[3,"pBind","class","click",4,"ngIf"],["pMotionName","p-collapsible","role","region",3,"pMotionOnAfterEnter","pBind","pMotion","pMotionOptions","id"],[3,"pBind"],[4,"ngTemplateOutlet"],[3,"pBind","class",4,"ngIf"],[3,"click","pBind"],["severity","secondary","type","button","role","button",3,"text","rounded","styleClass","buttonProps","pt","unstyled","click","keydown",4,"ngIf"],["severity","secondary","type","button","role","button",3,"click","keydown","text","rounded","styleClass","buttonProps","pt","unstyled"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["data-p-icon","minus",3,"pBind"],["data-p-icon","plus",3,"pBind"]],template:function(d,a){d&1&&(ne(ze),_(0,pt,7,12,"div",2),u(1,"div",3),N("pMotionOnAfterEnter",function(s){return a.onToggleDone(s)}),u(2,"div",4)(3,"div",4,0),V(5),_(6,ct,1,0,"ng-container",5),g(),_(7,st,3,4,"div",6),g()()),d&2&&(l("ngIf",a.showHeader),p(),T(a.cx("contentContainer")),l("pBind",a.ptm("contentContainer"))("pMotion",!a.toggleable||a.toggleable&&!a.collapsed)("pMotionOptions",a.computedMotionOptions())("id",a.id+"_content"),b("aria-labelledby",a.id+"_header")("aria-hidden",a.collapsed)("tabindex",a.collapsed?"-1":void 0),p(),T(a.cx("contentWrapper")),l("pBind",a.ptm("contentWrapper")),p(),T(a.cx("content")),l("pBind",a.ptm("content")),p(3),l("ngTemplateOutlet",a.contentTemplate||a._contentTemplate),p(),l("ngIf",a.footerFacet||a.footerTemplate||a._footerTemplate))},dependencies:[_e,se,R,be,ye,ve,xe,ge,Te,P,we,Be],encapsulation:2,changeDetection:0}));let e=t;return e})();export{Ct as a,zt as b};