UNPKG

@rero/sonar-ui

Version:

User interface for SONAR.

2 lines (1 loc) 4.63 kB
import{$a as z,Ab as Q,Ba as m,Ca as S,Cb as O,D as C,Da as E,Ea as A,Eb as R,F as I,G as u,Ga as b,Ha as h,Hc as q,Ic as G,Kc as H,Lb as V,Mc as $,Nc as J,Oa as p,Pa as F,Pc as l,Q as y,Qa as j,X as s,_ as k,ba as x,c as n,ca as B,da as d,fa as w,oa as c,pa as v,qa as T,ra as D,va as N,wa as M,yb as P}from"./chunk-OW4VQFLY.js";var K="\n .p-tag {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: dt('tag.primary.background');\n color: dt('tag.primary.color');\n font-size: dt('tag.font.size');\n font-weight: dt('tag.font.weight');\n padding: dt('tag.padding');\n border-radius: dt('tag.border.radius');\n gap: dt('tag.gap');\n }\n\n .p-tag-icon {\n font-size: dt('tag.icon.size');\n width: dt('tag.icon.size');\n height: dt('tag.icon.size');\n }\n\n .p-tag-rounded {\n border-radius: dt('tag.rounded.border.radius');\n }\n\n .p-tag-success {\n background: dt('tag.success.background');\n color: dt('tag.success.color');\n }\n\n .p-tag-info {\n background: dt('tag.info.background');\n color: dt('tag.info.color');\n }\n\n .p-tag-warn {\n background: dt('tag.warn.background');\n color: dt('tag.warn.color');\n }\n\n .p-tag-danger {\n background: dt('tag.danger.background');\n color: dt('tag.danger.color');\n }\n\n .p-tag-secondary {\n background: dt('tag.secondary.background');\n color: dt('tag.secondary.color');\n }\n\n .p-tag-contrast {\n background: dt('tag.contrast.background');\n color: dt('tag.contrast.color');\n }\n";var W=["icon"],X=["*"];function Y(t,a){if(t&1&&D(0,"span",4),t&2){let e=m(2);p(e.cx("icon")),c("ngClass",e.icon)("pBind",e.ptm("icon"))}}function Z(t,a){if(t&1&&(N(0),d(1,Y,1,4,"span",3),M()),t&2){let e=m();s(),c("ngIf",e.icon)}}function tt(t,a){}function et(t,a){t&1&&d(0,tt,0,0,"ng-template")}function nt(t,a){if(t&1&&(v(0,"span",2),d(1,et,1,0,null,5),T()),t&2){let e=m();p(e.cx("icon")),c("pBind",e.ptm("icon")),s(),c("ngTemplateOutlet",e.iconTemplate||e._iconTemplate)}}var ot={root:({instance:t})=>["p-tag p-component",{"p-tag-info":t.severity==="info","p-tag-success":t.severity==="success","p-tag-warn":t.severity==="warn","p-tag-danger":t.severity==="danger","p-tag-secondary":t.severity==="secondary","p-tag-contrast":t.severity==="contrast","p-tag-rounded":t.rounded}],icon:"p-tag-icon",label:"p-tag-label"},L=(()=>{let a=class a extends H{constructor(){super(...arguments);n(this,"name","tag");n(this,"style",K);n(this,"classes",ot)}};n(a,"\u0275fac",(()=>{let f;return function(i){return(f||(f=y(a)))(i||a)}})()),n(a,"\u0275prov",C({token:a,factory:a.\u0275fac}));let t=a;return t})();var U=new I("TAG_INSTANCE"),Bt=(()=>{var a;let e=class e extends J{constructor(){super(...arguments);n(this,"componentName","Tag");n(this,"$pcTag",(a=u(U,{optional:!0,skipSelf:!0}))!=null?a:void 0);n(this,"bindDirectiveInstance",u(l,{self:!0}));n(this,"styleClass");n(this,"severity");n(this,"value");n(this,"icon");n(this,"rounded");n(this,"iconTemplate");n(this,"templates");n(this,"_iconTemplate");n(this,"_componentStyle",u(L))}onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}onAfterContentInit(){var r;(r=this.templates)==null||r.forEach(i=>{i.getType()==="icon"&&(this._iconTemplate=i.template)})}get dataP(){return this.cn({rounded:this.rounded,[this.severity]:this.severity})}};n(e,"\u0275fac",(()=>{let r;return function(o){return(r||(r=y(e)))(o||e)}})()),n(e,"\u0275cmp",k({type:e,selectors:[["p-tag"]],contentQueries:function(i,o,_){if(i&1&&A(_,W,4)(_,q,4),i&2){let g;b(g=h())&&(o.iconTemplate=g.first),b(g=h())&&(o.templates=g)}},hostVars:3,hostBindings:function(i,o){i&2&&(w("data-p",o.dataP),p(o.cn(o.cx("root"),o.styleClass)))},inputs:{styleClass:"styleClass",severity:"severity",value:"value",icon:"icon",rounded:[2,"rounded","rounded",P]},features:[z([L,{provide:U,useExisting:e},{provide:$,useExisting:e}]),x([l]),B],ngContentSelectors:X,decls:5,vars:6,consts:[[4,"ngIf"],[3,"class","pBind",4,"ngIf"],[3,"pBind"],[3,"class","ngClass","pBind",4,"ngIf"],[3,"ngClass","pBind"],[4,"ngTemplateOutlet"]],template:function(i,o){i&1&&(S(),E(0),d(1,Z,2,1,"ng-container",0)(2,nt,2,4,"span",1),v(3,"span",2),F(4),T()),i&2&&(s(),c("ngIf",!o.iconTemplate&&!o._iconTemplate),s(),c("ngIf",o.iconTemplate||o._iconTemplate),s(),p(o.cx("label")),c("pBind",o.ptm("label")),s(),j(o.value))},dependencies:[V,Q,O,R,G,l],encapsulation:2,changeDetection:0}));let t=e;return t})();export{Bt as a};