master-page-vue 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,6 +21,7 @@ createApp(App)
21
21
  oidc: {
22
22
  authority: 'https://identity.example.com',
23
23
  clientId: 'mi-app',
24
+ clientSecret: 'client_secret'
24
25
  },
25
26
  appTitle: 'SISPRO - Mi Aplicación',
26
27
  })
@@ -279,7 +279,7 @@ const X = { class: "navbar-custom" }, Y = { class: "container-fluid" }, Z = {
279
279
  for (const [f, u] of d)
280
280
  n[f] = u;
281
281
  return n;
282
- }, D = /* @__PURE__ */ B(le, [["__scopeId", "data-v-18c38c67"]]), ce = { class: "shell-footer" }, de = { class: "container" }, ue = { class: "row" }, fe = { class: "col logos-col" }, pe = ["src"], he = ["src"], ge = /* @__PURE__ */ L({
282
+ }, D = /* @__PURE__ */ B(le, [["__scopeId", "data-v-f65642f7"]]), ce = { class: "shell-footer" }, de = { class: "container" }, ue = { class: "row" }, fe = { class: "col logos-col" }, pe = ["src"], he = ["src"], ge = /* @__PURE__ */ L({
283
283
  __name: "AppFooter",
284
284
  setup(h) {
285
285
  var f, u;
@@ -1 +1 @@
1
- (function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.MasterPageVue={},m.Vue,m.OidcClientTs))})(this,function(m,e,x){"use strict";const C=e.ref(!1),A=e.ref(null),I=e.ref([]),j=e.ref(!0);let u,p,_=null;function V(){function f(o){u=o;const t={authority:o.oidc.authority,client_id:o.oidc.clientId,client_secret:o.oidc.clientSecret,redirect_uri:o.oidc.redirectUri??`${window.location.origin}?op=2`,response_type:o.oidc.responseType??"code",scope:o.oidc.scope??"openid profile email roles offline_access",post_logout_redirect_uri:o.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`};p=new x.UserManager(t),r(),y()}function i(){return u}function a(){p.signinRedirect({prompt:"login"})}function d(){const o=localStorage.getItem("access_token")??"",t=encodeURIComponent(u.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`);window.location.href=`${u.oidc.authority}/connect/logout?id_token_hint=${o}&post_logout_redirect_uri=${t}`}function c(){window.location.href=`${u.oidc.authority}/Identity/Account/Manage?salir=1`}async function g(){const o=await p.getUser();return(o==null?void 0:o.access_token)??null}function r(){const o=new URLSearchParams(window.location.search).get("op");o==="2"&&p.signinRedirectCallback().then(()=>{window.location.href="/"}).catch(t=>console.error("[MasterPage] signin callback error:",t)),o==="1"&&p.signoutRedirectCallback().then(()=>{p.removeUser(),window.location.href="/"}).catch(t=>console.error("[MasterPage] signout callback error:",t))}async function y(){try{const o=await p.getUser();o&&!o.expired?(b(o),u.enableFetchInterceptor!==!1&&s(),await k(o)):(C.value=!1,A.value=null)}catch(o){console.error("[MasterPage] session check error:",o),C.value=!1}finally{j.value=!1}}function b(o){const t=o.profile;A.value={firstName:t.UserFirstName??"",middleName:t.UserMiddleName??"",lastName:t.UserLastName??"",secondLastName:t.UserSecondLastName??"",enterpriseName:t.EnterpriseName??"",displayName:[t.UserFirstName,t.UserMiddleName,t.UserLastName,t.UserSecondLastName].filter(Boolean).join(" ").trim(),email:t.email??"",accessToken:o.access_token,rawClaims:t},localStorage.setItem("access_token",o.access_token),C.value=!0}async function k(o){var t;try{const l=await fetch(`${u.oidc.authority}/connect/userinfo`,{headers:{Authorization:`Bearer ${o.access_token}`}});if(!l.ok)return;const w=await l.json();(t=w==null?void 0:w.usrAuthorizations)!=null&&t.aplicaciones&&(I.value=w.usrAuthorizations.aplicaciones)}catch(l){console.error("[MasterPage] Failed to fetch authorizations:",l)}}function s(){if(_)return;_=window.fetch.bind(window);const o=u.oidc.authority;window.fetch=async(t,l={})=>{if((typeof t=="string"?t:t.url).startsWith(o))return _(t,l);let h=await p.getUser();h&&!h.expired&&(l.headers={...l.headers,Authorization:`Bearer ${h.access_token}`});let n=await _(t,l);if(n.status===401&&h)try{const E=await p.signinSilent();E&&(b(E),l.headers={...l.headers,Authorization:`Bearer ${E.access_token}`},n=await _(t,l))}catch{await p.signoutRedirect()}return n}}function N(){_&&(window.fetch=_,_=null)}return{isAuthenticated:e.readonly(C),userProfile:e.readonly(A),menuItems:e.readonly(I),isLoading:e.readonly(j),configure:f,getConfig:i,login:a,logout:d,openAccountSettings:c,getAccessToken:g,destroyFetchInterceptor:N}}const T={class:"navbar-custom"},O={class:"container-fluid"},F={class:"navbar-brand",href:"#"},z=["src"],R={class:"brand-text"},D={class:"navbar-right"},H={key:0,class:"nav-item"},q={class:"user-label"},G={class:"user-name"},K={class:"user-enterprise"},W={key:1,class:"auth-buttons"},J=e.defineComponent({__name:"AppHeader",emits:["menu-toggle"],setup(f,{emit:i}){var w;const a=i,{isAuthenticated:d,userProfile:c,login:g,logout:r,openAccountSettings:y,getConfig:b}=V(),k=e.ref(!1),s=b(),N=(s==null?void 0:s.appTitle)??"SISPRO - Aplicativos Misionales",o=((w=s==null?void 0:s.oidc)==null?void 0:w.authority)??"";function t(h){h.stopPropagation(),k.value=!k.value}function l(){var n;const h=(n=b())==null?void 0:n.registerUrl;h&&(window.location.href=h)}return(h,n)=>{var E,L;return e.openBlock(),e.createElementBlock("nav",T,[e.createElementVNode("div",O,[e.unref(d)?(e.openBlock(),e.createElementBlock("button",{key:0,class:"menu-toggle",onClick:n[0]||(n[0]=B=>a("menu-toggle")),"aria-label":"Toggle menu"}," ☰ ")):e.createCommentVNode("",!0),e.createElementVNode("a",F,[e.createElementVNode("img",{src:`${e.unref(o)}/img/logo.svg`,alt:"Logo gov.co"},null,8,z),e.createElementVNode("span",R,e.toDisplayString(e.unref(N)),1)]),e.createElementVNode("div",D,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("button",{class:"user-dropdown-btn",onClick:t,"aria-label":"Opciones de usuario"},[e.createElementVNode("div",q,[e.createElementVNode("span",G,e.toDisplayString((E=e.unref(c))==null?void 0:E.displayName),1),e.createElementVNode("span",K,e.toDisplayString((L=e.unref(c))==null?void 0:L.enterpriseName),1)]),n[5]||(n[5]=e.createElementVNode("div",{class:"user-avatar"},[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"})])],-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["chevron",{rotated:k.value}]),width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[...n[4]||(n[4]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))]),e.createElementVNode("ul",{class:e.normalizeClass(["dropdown-menu",{open:k.value}])},[e.createElementVNode("li",null,[e.createElementVNode("a",{onClick:n[1]||(n[1]=(...B)=>e.unref(y)&&e.unref(y)(...B))},[...n[6]||(n[6]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1),e.createTextVNode(" Configuración ",-1)])])]),n[8]||(n[8]=e.createElementVNode("li",{class:"divider"},null,-1)),e.createElementVNode("li",null,[e.createElementVNode("a",{class:"logout-item",onClick:n[2]||(n[2]=(...B)=>e.unref(r)&&e.unref(r)(...B))},[...n[7]||(n[7]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),e.createElementVNode("polyline",{points:"16 17 21 12 16 7"}),e.createElementVNode("line",{x1:"21",y1:"12",x2:"9",y2:"12"})],-1),e.createTextVNode(" Cerrar sesión ",-1)])])])],2)])):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("button",{class:"btn-login",onClick:n[3]||(n[3]=(...B)=>e.unref(g)&&e.unref(g)(...B))},"Ingresar"),e.createElementVNode("button",{class:"btn-register",onClick:l},"Registrarse")]))])])])}}}),$=(f,i)=>{const a=f.__vccOpts||f;for(const[d,c]of i)a[d]=c;return a},S=$(J,[["__scopeId","data-v-18c38c67"]]),Q={class:"shell-footer"},X={class:"container"},Y={class:"row"},Z={class:"col logos-col"},v=["src"],ee=["src"],M=$(e.defineComponent({__name:"AppFooter",setup(f){var d,c;const{getConfig:i}=V(),a=((c=(d=i())==null?void 0:d.oidc)==null?void 0:c.authority)??"";return(g,r)=>(e.openBlock(),e.createElementBlock("footer",Q,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("img",{src:`${e.unref(a)}/img/logo.svg`,alt:"GOV.CO",class:"footer-logo"},null,8,v),e.createElementVNode("img",{src:`${e.unref(a)}/img/colombia.png`,alt:"Colombia Potencia de la Vida",class:"footer-logo"},null,8,ee)]),r[0]||(r[0]=e.createStaticVNode('<div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>SISPRO</strong><p data-v-93fe5bbf> Dirección:<br data-v-93fe5bbf> Carrera 13 # 32–76 (piso 1)<br data-v-93fe5bbf> Cundinamarca, Bogotá D.C.<br data-v-93fe5bbf> Código Postal: 110311 </p><p data-v-93fe5bbf><a href="#" class="footer-link" data-v-93fe5bbf>Horario de atención:</a><br data-v-93fe5bbf> Lunes a viernes 8:00 a.m. a 4:00 p.m. </p></div><div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>Contacto</strong><p data-v-93fe5bbf> Teléfono conmutador:<br data-v-93fe5bbf> En Bogotá: 601 330 5043 Opción 2<br data-v-93fe5bbf> Resto del país: 018000960020 Opción 2 </p><p data-v-93fe5bbf> Correo de notificaciones judiciales:<br data-v-93fe5bbf><a href="mailto:notificacionesjudiciales@minsalud.gov.co" class="footer-link" data-v-93fe5bbf> notificacionesjudiciales@minsalud.gov.co </a></p><p data-v-93fe5bbf><a href="https://www.minsalud.gov.co/Documents/Ministerio/Terminos%20y%20Condiciones%20de%20uso%20del%20portal%20web_Octubre%202012x.pdf" target="_blank" class="footer-link" data-v-93fe5bbf> Términos y condiciones </a></p></div>',2))])])]))}}),[["__scopeId","data-v-93fe5bbf"]]),oe={class:"menu-list"},te=["onClick"],ne=["href"],ae={key:2,class:"submenu"},se=["onClick"],re=["href"],le={key:2,class:"submenu"},ie=["href"],U=$(e.defineComponent({__name:"AppMenu",props:{isOpen:{type:Boolean}},setup(f){const{menuItems:i}=V(),a=e.ref(new Set);function d(c){a.value.has(c)?a.value.delete(c):a.value.add(c),a.value=new Set(a.value)}return(c,g)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["sidebar-menu",{show:f.isOpen}])},[e.createElementVNode("ul",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),r=>{var y,b,k;return e.openBlock(),e.createElementBlock("li",{key:r.nombre,class:e.normalizeClass({"has-submenu":(y=r.hijos)==null?void 0:y.length,open:a.value.has(r)})},[(b=r.hijos)!=null&&b.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:s=>d(r)},e.toDisplayString(r.nombre),9,te)):(e.openBlock(),e.createElementBlock("a",{key:1,href:r.url||"#"},e.toDisplayString(r.nombre),9,ne)),(k=r.hijos)!=null&&k.length&&a.value.has(r)?(e.openBlock(),e.createElementBlock("ul",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.hijos,s=>{var N,o,t;return e.openBlock(),e.createElementBlock("li",{key:s.nombre,class:e.normalizeClass({"has-submenu":(N=s.hijos)==null?void 0:N.length,open:a.value.has(s)})},[(o=s.hijos)!=null&&o.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:l=>d(s)},e.toDisplayString(s.nombre),9,se)):(e.openBlock(),e.createElementBlock("a",{key:1,href:s.url||"#"},e.toDisplayString(s.nombre),9,re)),(t=s.hijos)!=null&&t.length&&a.value.has(s)?(e.openBlock(),e.createElementBlock("ul",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.hijos,l=>(e.openBlock(),e.createElementBlock("li",{key:l.nombre},[e.createElementVNode("a",{href:l.url||"#"},e.toDisplayString(l.nombre),9,ie)]))),128))])):e.createCommentVNode("",!0)],2)}),128))])):e.createCommentVNode("",!0)],2)}),128))])],2))}}),[["__scopeId","data-v-1619503d"]]),ce={class:"master-page-layout"},de={class:"shell-main"},P=$(e.defineComponent({__name:"MasterPage",setup(f){const i=e.ref(!1);function a(){i.value=!i.value}function d(){i.value=!1}function c(g){g.key==="Escape"&&d()}return window.addEventListener("keydown",c),e.onUnmounted(()=>window.removeEventListener("keydown",c)),(g,r)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(S,{onMenuToggle:a}),e.createVNode(U,{"is-open":i.value},null,8,["is-open"]),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sidebar-backdrop",onClick:d})):e.createCommentVNode("",!0),e.createElementVNode("main",de,[e.renderSlot(g.$slots,"default",{},void 0,!0)]),e.createVNode(M)]))}}),[["__scopeId","data-v-ad151b79"]]),fe={install(f,i){const{configure:a}=V();a(i),f.component("MasterPage",P),f.component("AppHeader",S),f.component("AppFooter",M),f.component("AppMenu",U)}};m.AppFooter=M,m.AppHeader=S,m.AppMenu=U,m.MasterPage=P,m.default=fe,m.useAuth=V,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.MasterPageVue={},m.Vue,m.OidcClientTs))})(this,function(m,e,x){"use strict";const C=e.ref(!1),A=e.ref(null),I=e.ref([]),j=e.ref(!0);let u,p,_=null;function V(){function f(o){u=o;const t={authority:o.oidc.authority,client_id:o.oidc.clientId,client_secret:o.oidc.clientSecret,redirect_uri:o.oidc.redirectUri??`${window.location.origin}?op=2`,response_type:o.oidc.responseType??"code",scope:o.oidc.scope??"openid profile email roles offline_access",post_logout_redirect_uri:o.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`};p=new x.UserManager(t),r(),y()}function i(){return u}function a(){p.signinRedirect({prompt:"login"})}function d(){const o=localStorage.getItem("access_token")??"",t=encodeURIComponent(u.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`);window.location.href=`${u.oidc.authority}/connect/logout?id_token_hint=${o}&post_logout_redirect_uri=${t}`}function c(){window.location.href=`${u.oidc.authority}/Identity/Account/Manage?salir=1`}async function g(){const o=await p.getUser();return(o==null?void 0:o.access_token)??null}function r(){const o=new URLSearchParams(window.location.search).get("op");o==="2"&&p.signinRedirectCallback().then(()=>{window.location.href="/"}).catch(t=>console.error("[MasterPage] signin callback error:",t)),o==="1"&&p.signoutRedirectCallback().then(()=>{p.removeUser(),window.location.href="/"}).catch(t=>console.error("[MasterPage] signout callback error:",t))}async function y(){try{const o=await p.getUser();o&&!o.expired?(b(o),u.enableFetchInterceptor!==!1&&s(),await k(o)):(C.value=!1,A.value=null)}catch(o){console.error("[MasterPage] session check error:",o),C.value=!1}finally{j.value=!1}}function b(o){const t=o.profile;A.value={firstName:t.UserFirstName??"",middleName:t.UserMiddleName??"",lastName:t.UserLastName??"",secondLastName:t.UserSecondLastName??"",enterpriseName:t.EnterpriseName??"",displayName:[t.UserFirstName,t.UserMiddleName,t.UserLastName,t.UserSecondLastName].filter(Boolean).join(" ").trim(),email:t.email??"",accessToken:o.access_token,rawClaims:t},localStorage.setItem("access_token",o.access_token),C.value=!0}async function k(o){var t;try{const l=await fetch(`${u.oidc.authority}/connect/userinfo`,{headers:{Authorization:`Bearer ${o.access_token}`}});if(!l.ok)return;const w=await l.json();(t=w==null?void 0:w.usrAuthorizations)!=null&&t.aplicaciones&&(I.value=w.usrAuthorizations.aplicaciones)}catch(l){console.error("[MasterPage] Failed to fetch authorizations:",l)}}function s(){if(_)return;_=window.fetch.bind(window);const o=u.oidc.authority;window.fetch=async(t,l={})=>{if((typeof t=="string"?t:t.url).startsWith(o))return _(t,l);let h=await p.getUser();h&&!h.expired&&(l.headers={...l.headers,Authorization:`Bearer ${h.access_token}`});let n=await _(t,l);if(n.status===401&&h)try{const E=await p.signinSilent();E&&(b(E),l.headers={...l.headers,Authorization:`Bearer ${E.access_token}`},n=await _(t,l))}catch{await p.signoutRedirect()}return n}}function N(){_&&(window.fetch=_,_=null)}return{isAuthenticated:e.readonly(C),userProfile:e.readonly(A),menuItems:e.readonly(I),isLoading:e.readonly(j),configure:f,getConfig:i,login:a,logout:d,openAccountSettings:c,getAccessToken:g,destroyFetchInterceptor:N}}const T={class:"navbar-custom"},O={class:"container-fluid"},F={class:"navbar-brand",href:"#"},z=["src"],R={class:"brand-text"},D={class:"navbar-right"},H={key:0,class:"nav-item"},q={class:"user-label"},G={class:"user-name"},K={class:"user-enterprise"},W={key:1,class:"auth-buttons"},J=e.defineComponent({__name:"AppHeader",emits:["menu-toggle"],setup(f,{emit:i}){var w;const a=i,{isAuthenticated:d,userProfile:c,login:g,logout:r,openAccountSettings:y,getConfig:b}=V(),k=e.ref(!1),s=b(),N=(s==null?void 0:s.appTitle)??"SISPRO - Aplicativos Misionales",o=((w=s==null?void 0:s.oidc)==null?void 0:w.authority)??"";function t(h){h.stopPropagation(),k.value=!k.value}function l(){var n;const h=(n=b())==null?void 0:n.registerUrl;h&&(window.location.href=h)}return(h,n)=>{var E,L;return e.openBlock(),e.createElementBlock("nav",T,[e.createElementVNode("div",O,[e.unref(d)?(e.openBlock(),e.createElementBlock("button",{key:0,class:"menu-toggle",onClick:n[0]||(n[0]=B=>a("menu-toggle")),"aria-label":"Toggle menu"}," ☰ ")):e.createCommentVNode("",!0),e.createElementVNode("a",F,[e.createElementVNode("img",{src:`${e.unref(o)}/img/logo.svg`,alt:"Logo gov.co"},null,8,z),e.createElementVNode("span",R,e.toDisplayString(e.unref(N)),1)]),e.createElementVNode("div",D,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("button",{class:"user-dropdown-btn",onClick:t,"aria-label":"Opciones de usuario"},[e.createElementVNode("div",q,[e.createElementVNode("span",G,e.toDisplayString((E=e.unref(c))==null?void 0:E.displayName),1),e.createElementVNode("span",K,e.toDisplayString((L=e.unref(c))==null?void 0:L.enterpriseName),1)]),n[5]||(n[5]=e.createElementVNode("div",{class:"user-avatar"},[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"})])],-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["chevron",{rotated:k.value}]),width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[...n[4]||(n[4]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))]),e.createElementVNode("ul",{class:e.normalizeClass(["dropdown-menu",{open:k.value}])},[e.createElementVNode("li",null,[e.createElementVNode("a",{onClick:n[1]||(n[1]=(...B)=>e.unref(y)&&e.unref(y)(...B))},[...n[6]||(n[6]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1),e.createTextVNode(" Configuración ",-1)])])]),n[8]||(n[8]=e.createElementVNode("li",{class:"divider"},null,-1)),e.createElementVNode("li",null,[e.createElementVNode("a",{class:"logout-item",onClick:n[2]||(n[2]=(...B)=>e.unref(r)&&e.unref(r)(...B))},[...n[7]||(n[7]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),e.createElementVNode("polyline",{points:"16 17 21 12 16 7"}),e.createElementVNode("line",{x1:"21",y1:"12",x2:"9",y2:"12"})],-1),e.createTextVNode(" Cerrar sesión ",-1)])])])],2)])):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("button",{class:"btn-login",onClick:n[3]||(n[3]=(...B)=>e.unref(g)&&e.unref(g)(...B))},"Ingresar"),e.createElementVNode("button",{class:"btn-register",onClick:l},"Registrarse")]))])])])}}}),$=(f,i)=>{const a=f.__vccOpts||f;for(const[d,c]of i)a[d]=c;return a},S=$(J,[["__scopeId","data-v-f65642f7"]]),Q={class:"shell-footer"},X={class:"container"},Y={class:"row"},Z={class:"col logos-col"},v=["src"],ee=["src"],M=$(e.defineComponent({__name:"AppFooter",setup(f){var d,c;const{getConfig:i}=V(),a=((c=(d=i())==null?void 0:d.oidc)==null?void 0:c.authority)??"";return(g,r)=>(e.openBlock(),e.createElementBlock("footer",Q,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("img",{src:`${e.unref(a)}/img/logo.svg`,alt:"GOV.CO",class:"footer-logo"},null,8,v),e.createElementVNode("img",{src:`${e.unref(a)}/img/colombia.png`,alt:"Colombia Potencia de la Vida",class:"footer-logo"},null,8,ee)]),r[0]||(r[0]=e.createStaticVNode('<div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>SISPRO</strong><p data-v-93fe5bbf> Dirección:<br data-v-93fe5bbf> Carrera 13 # 32–76 (piso 1)<br data-v-93fe5bbf> Cundinamarca, Bogotá D.C.<br data-v-93fe5bbf> Código Postal: 110311 </p><p data-v-93fe5bbf><a href="#" class="footer-link" data-v-93fe5bbf>Horario de atención:</a><br data-v-93fe5bbf> Lunes a viernes 8:00 a.m. a 4:00 p.m. </p></div><div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>Contacto</strong><p data-v-93fe5bbf> Teléfono conmutador:<br data-v-93fe5bbf> En Bogotá: 601 330 5043 Opción 2<br data-v-93fe5bbf> Resto del país: 018000960020 Opción 2 </p><p data-v-93fe5bbf> Correo de notificaciones judiciales:<br data-v-93fe5bbf><a href="mailto:notificacionesjudiciales@minsalud.gov.co" class="footer-link" data-v-93fe5bbf> notificacionesjudiciales@minsalud.gov.co </a></p><p data-v-93fe5bbf><a href="https://www.minsalud.gov.co/Documents/Ministerio/Terminos%20y%20Condiciones%20de%20uso%20del%20portal%20web_Octubre%202012x.pdf" target="_blank" class="footer-link" data-v-93fe5bbf> Términos y condiciones </a></p></div>',2))])])]))}}),[["__scopeId","data-v-93fe5bbf"]]),oe={class:"menu-list"},te=["onClick"],ne=["href"],ae={key:2,class:"submenu"},se=["onClick"],re=["href"],le={key:2,class:"submenu"},ie=["href"],U=$(e.defineComponent({__name:"AppMenu",props:{isOpen:{type:Boolean}},setup(f){const{menuItems:i}=V(),a=e.ref(new Set);function d(c){a.value.has(c)?a.value.delete(c):a.value.add(c),a.value=new Set(a.value)}return(c,g)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["sidebar-menu",{show:f.isOpen}])},[e.createElementVNode("ul",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),r=>{var y,b,k;return e.openBlock(),e.createElementBlock("li",{key:r.nombre,class:e.normalizeClass({"has-submenu":(y=r.hijos)==null?void 0:y.length,open:a.value.has(r)})},[(b=r.hijos)!=null&&b.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:s=>d(r)},e.toDisplayString(r.nombre),9,te)):(e.openBlock(),e.createElementBlock("a",{key:1,href:r.url||"#"},e.toDisplayString(r.nombre),9,ne)),(k=r.hijos)!=null&&k.length&&a.value.has(r)?(e.openBlock(),e.createElementBlock("ul",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.hijos,s=>{var N,o,t;return e.openBlock(),e.createElementBlock("li",{key:s.nombre,class:e.normalizeClass({"has-submenu":(N=s.hijos)==null?void 0:N.length,open:a.value.has(s)})},[(o=s.hijos)!=null&&o.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:l=>d(s)},e.toDisplayString(s.nombre),9,se)):(e.openBlock(),e.createElementBlock("a",{key:1,href:s.url||"#"},e.toDisplayString(s.nombre),9,re)),(t=s.hijos)!=null&&t.length&&a.value.has(s)?(e.openBlock(),e.createElementBlock("ul",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.hijos,l=>(e.openBlock(),e.createElementBlock("li",{key:l.nombre},[e.createElementVNode("a",{href:l.url||"#"},e.toDisplayString(l.nombre),9,ie)]))),128))])):e.createCommentVNode("",!0)],2)}),128))])):e.createCommentVNode("",!0)],2)}),128))])],2))}}),[["__scopeId","data-v-1619503d"]]),ce={class:"master-page-layout"},de={class:"shell-main"},P=$(e.defineComponent({__name:"MasterPage",setup(f){const i=e.ref(!1);function a(){i.value=!i.value}function d(){i.value=!1}function c(g){g.key==="Escape"&&d()}return window.addEventListener("keydown",c),e.onUnmounted(()=>window.removeEventListener("keydown",c)),(g,r)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(S,{onMenuToggle:a}),e.createVNode(U,{"is-open":i.value},null,8,["is-open"]),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sidebar-backdrop",onClick:d})):e.createCommentVNode("",!0),e.createElementVNode("main",de,[e.renderSlot(g.$slots,"default",{},void 0,!0)]),e.createVNode(M)]))}}),[["__scopeId","data-v-ad151b79"]]),fe={install(f,i){const{configure:a}=V();a(i),f.component("MasterPage",P),f.component("AppHeader",S),f.component("AppFooter",M),f.component("AppMenu",U)}};m.AppFooter=M,m.AppHeader=S,m.AppMenu=U,m.MasterPage=P,m.default=fe,m.useAuth=V,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .navbar-custom[data-v-18c38c67]{background-color:#36c;box-shadow:0 4px 10px #0003;position:fixed;width:100%;z-index:1001;height:60px}.container-fluid[data-v-18c38c67]{display:flex;align-items:center;width:100%;padding:0 15px}.navbar-brand[data-v-18c38c67]{color:#fff;display:flex;align-items:center;gap:10px;text-decoration:none}.navbar-brand img[data-v-18c38c67]{height:36px;margin-top:1px}.brand-text[data-v-18c38c67]{padding-top:5px}.navbar-right[data-v-18c38c67]{display:flex;align-items:center;margin-left:auto;flex-shrink:0}.nav-item[data-v-18c38c67]{position:relative;margin-right:22px}.user-dropdown-btn[data-v-18c38c67]{display:flex;align-items:center;background:transparent;color:#fff;cursor:pointer;padding:6px 12px;transition:background .2s;overflow:hidden}.user-label[data-v-18c38c67]{text-align:left;line-height:1.2;overflow:hidden}.user-name[data-v-18c38c67]{display:block;font-weight:600;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-enterprise[data-v-18c38c67]{display:block;font-size:.75rem;color:#c8d8f8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-avatar[data-v-18c38c67]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:#ffffff40;flex-shrink:0}.chevron[data-v-18c38c67]{flex-shrink:0;transition:transform .2s}.chevron.rotated[data-v-18c38c67]{transform:rotate(180deg)}.dropdown-menu[data-v-18c38c67]{display:none;position:absolute;right:0;top:calc(100% + 8px);min-width:210px;background:#fff;border:1px solid #e0e0e0;box-shadow:0 4px 16px #0000001f;border-radius:10px;list-style:none;margin:0;padding:6px 0;z-index:1002}.dropdown-menu.open[data-v-18c38c67]{display:block}.dropdown-menu li a[data-v-18c38c67]{display:flex;align-items:center;gap:10px;padding:10px 16px;color:#333;cursor:pointer;text-decoration:none;font-size:.9rem;transition:background .15s}.dropdown-menu li a[data-v-18c38c67]:hover{background:#f0f4ff}.dropdown-menu .divider[data-v-18c38c67]{height:1px;background:#eee;margin:4px 0}.dropdown-menu .logout-item[data-v-18c38c67]{color:#c0392b}.dropdown-menu .logout-item[data-v-18c38c67]:hover{background:#fff5f5}.auth-buttons[data-v-18c38c67]{display:flex;align-items:center;gap:8px;flex-shrink:0;margin-right:27px}.btn-login[data-v-18c38c67],.btn-register[data-v-18c38c67]{border-radius:20px;font-weight:500;border:1px solid white;padding:6px 16px;cursor:pointer;white-space:nowrap;font-size:.875rem}.btn-login[data-v-18c38c67]{color:#fff;background:transparent}.btn-login[data-v-18c38c67]:hover{background:#ffffff26}.btn-register[data-v-18c38c67]{color:#36c;background:#fff}.btn-register[data-v-18c38c67]:hover{background:#e8eeff}.menu-toggle[data-v-18c38c67]{font-size:30px;border:none;background:transparent;color:#fff;cursor:pointer;margin-right:15px;padding:0;line-height:1;flex-shrink:0}@media (max-width: 860px){.navbar-brand[data-v-18c38c67]{display:none}}@media (max-width: 520px){.user-label[data-v-18c38c67],.chevron[data-v-18c38c67]{display:none}.user-dropdown-btn[data-v-18c38c67]{padding:6px;border-radius:50%}.btn-login[data-v-18c38c67],.btn-register[data-v-18c38c67]{padding:6px 10px;font-size:.8rem}}.shell-footer[data-v-93fe5bbf]{background-color:#36c;color:#fff;padding:1.5rem 0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:1em;width:100%}.container[data-v-93fe5bbf]{max-width:1200px;margin:0 auto;padding:0 15px}.row[data-v-93fe5bbf]{display:flex;flex-wrap:wrap;align-items:flex-start}.col[data-v-93fe5bbf]{flex:1;padding:0 15px}.logos-col[data-v-93fe5bbf]{display:flex;align-items:center;justify-content:center;gap:16px}.footer-logo[data-v-93fe5bbf]{max-height:50px}.border-start[data-v-93fe5bbf]{border-left:1px solid rgba(255,255,255,.3)}.footer-link[data-v-93fe5bbf]{color:#fff;text-decoration:underline}strong[data-v-93fe5bbf]{display:block;margin-bottom:.5rem}p[data-v-93fe5bbf]{margin:.25rem 0;line-height:1.5}@media (max-width: 768px){.col[data-v-93fe5bbf]{flex:0 0 100%;margin-bottom:1rem}.border-start[data-v-93fe5bbf]{border-left:none}}.sidebar-menu[data-v-1619503d]{position:fixed;top:0;left:0;height:100vh;width:300px;background-color:#36c;padding-top:60px;transform:translate(-100%);transition:transform .3s ease;z-index:1000;overflow-y:auto}.sidebar-menu.show[data-v-1619503d]{transform:translate(0)}.menu-list[data-v-1619503d],.submenu[data-v-1619503d]{list-style:none;padding:0;margin:0}.submenu[data-v-1619503d]{padding-left:10px}li a[data-v-1619503d],li span[data-v-1619503d]{display:block;padding:10px;color:#fff;text-decoration:none;font-weight:500;cursor:pointer}li a[data-v-1619503d]:hover,li span[data-v-1619503d]:hover{background-color:#2952a3}.has-submenu>span.has-children[data-v-1619503d]:after{content:" ▼";font-size:.8em;float:right}.has-submenu.open>span.has-children[data-v-1619503d]:after{content:" ▲"}.master-page-layout[data-v-ad151b79]{display:flex;flex-direction:column;min-height:100vh;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.shell-main[data-v-ad151b79]{flex:1;padding-top:65px;min-height:calc(100vh - 260px)}.sidebar-backdrop[data-v-ad151b79]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000059;z-index:999;cursor:pointer;transition:opacity .3s ease}
1
+ .navbar-custom[data-v-f65642f7]{background-color:#36c;box-shadow:0 4px 10px #0003;position:fixed;width:100%;z-index:1001;height:60px}.container-fluid[data-v-f65642f7]{display:flex;align-items:center;width:100%;padding:0 15px}.navbar-brand[data-v-f65642f7]{color:#fff;display:flex;align-items:center;gap:10px;text-decoration:none}.navbar-brand img[data-v-f65642f7]{height:36px;margin-top:1px}.brand-text[data-v-f65642f7]{padding-top:5px}.navbar-right[data-v-f65642f7]{display:flex;align-items:center;margin-left:auto;flex-shrink:0}.nav-item[data-v-f65642f7]{position:relative;margin-right:22px}.user-dropdown-btn[data-v-f65642f7]{display:flex;align-items:center;background:transparent;color:#fff;cursor:pointer;padding:6px 12px;transition:background .2s;overflow:hidden;border-color:transparent}.user-label[data-v-f65642f7]{text-align:left;line-height:1.2;overflow:hidden}.user-name[data-v-f65642f7]{display:block;font-weight:600;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-enterprise[data-v-f65642f7]{display:block;font-size:.75rem;color:#c8d8f8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-avatar[data-v-f65642f7]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:#ffffff40;flex-shrink:0}.chevron[data-v-f65642f7]{flex-shrink:0;transition:transform .2s}.chevron.rotated[data-v-f65642f7]{transform:rotate(180deg)}.dropdown-menu[data-v-f65642f7]{display:none;position:absolute;right:0;top:calc(100% + 8px);min-width:210px;background:#fff;border:1px solid #e0e0e0;box-shadow:0 4px 16px #0000001f;border-radius:10px;list-style:none;margin:0;padding:6px 0;z-index:1002}.dropdown-menu.open[data-v-f65642f7]{display:block}.dropdown-menu li a[data-v-f65642f7]{display:flex;align-items:center;gap:10px;padding:10px 16px;color:#333;cursor:pointer;text-decoration:none;font-size:.9rem;transition:background .15s}.dropdown-menu li a[data-v-f65642f7]:hover{background:#f0f4ff}.dropdown-menu .divider[data-v-f65642f7]{height:1px;background:#eee;margin:4px 0}.dropdown-menu .logout-item[data-v-f65642f7]{color:#c0392b}.dropdown-menu .logout-item[data-v-f65642f7]:hover{background:#fff5f5}.auth-buttons[data-v-f65642f7]{display:flex;align-items:center;gap:8px;flex-shrink:0;margin-right:27px}.btn-login[data-v-f65642f7],.btn-register[data-v-f65642f7]{border-radius:20px;font-weight:500;border:1px solid white;padding:6px 16px;cursor:pointer;white-space:nowrap;font-size:.875rem}.btn-login[data-v-f65642f7]{color:#fff;background:transparent}.btn-login[data-v-f65642f7]:hover{background:#ffffff26}.btn-register[data-v-f65642f7]{color:#36c;background:#fff}.btn-register[data-v-f65642f7]:hover{background:#e8eeff}.menu-toggle[data-v-f65642f7]{font-size:30px;border:none;background:transparent;color:#fff;cursor:pointer;margin-right:15px;padding:0;line-height:1;flex-shrink:0}@media (max-width: 860px){.navbar-brand[data-v-f65642f7]{display:none}}@media (max-width: 520px){.user-label[data-v-f65642f7],.chevron[data-v-f65642f7]{display:none}.user-dropdown-btn[data-v-f65642f7]{padding:6px;border-radius:50%}.btn-login[data-v-f65642f7],.btn-register[data-v-f65642f7]{padding:6px 10px;font-size:.8rem}}.shell-footer[data-v-93fe5bbf]{background-color:#36c;color:#fff;padding:1.5rem 0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:1em;width:100%}.container[data-v-93fe5bbf]{max-width:1200px;margin:0 auto;padding:0 15px}.row[data-v-93fe5bbf]{display:flex;flex-wrap:wrap;align-items:flex-start}.col[data-v-93fe5bbf]{flex:1;padding:0 15px}.logos-col[data-v-93fe5bbf]{display:flex;align-items:center;justify-content:center;gap:16px}.footer-logo[data-v-93fe5bbf]{max-height:50px}.border-start[data-v-93fe5bbf]{border-left:1px solid rgba(255,255,255,.3)}.footer-link[data-v-93fe5bbf]{color:#fff;text-decoration:underline}strong[data-v-93fe5bbf]{display:block;margin-bottom:.5rem}p[data-v-93fe5bbf]{margin:.25rem 0;line-height:1.5}@media (max-width: 768px){.col[data-v-93fe5bbf]{flex:0 0 100%;margin-bottom:1rem}.border-start[data-v-93fe5bbf]{border-left:none}}.sidebar-menu[data-v-1619503d]{position:fixed;top:0;left:0;height:100vh;width:300px;background-color:#36c;padding-top:60px;transform:translate(-100%);transition:transform .3s ease;z-index:1000;overflow-y:auto}.sidebar-menu.show[data-v-1619503d]{transform:translate(0)}.menu-list[data-v-1619503d],.submenu[data-v-1619503d]{list-style:none;padding:0;margin:0}.submenu[data-v-1619503d]{padding-left:10px}li a[data-v-1619503d],li span[data-v-1619503d]{display:block;padding:10px;color:#fff;text-decoration:none;font-weight:500;cursor:pointer}li a[data-v-1619503d]:hover,li span[data-v-1619503d]:hover{background-color:#2952a3}.has-submenu>span.has-children[data-v-1619503d]:after{content:" ▼";font-size:.8em;float:right}.has-submenu.open>span.has-children[data-v-1619503d]:after{content:" ▲"}.master-page-layout[data-v-ad151b79]{display:flex;flex-direction:column;min-height:100vh;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.shell-main[data-v-ad151b79]{flex:1;padding-top:65px;min-height:calc(100vh - 260px)}.sidebar-backdrop[data-v-ad151b79]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000059;z-index:999;cursor:pointer;transition:opacity .3s ease}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "master-page-vue",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Master page layout with OIDC auth for Vue 3",
5
5
  "main": "./dist/master-page-vue.umd.js",
6
6
  "module": "./dist/master-page-vue.mjs",