@bobbykim/mcl-header 0.6.4 → 0.7.0
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/dist/index.d.ts +417 -236
- package/dist/mcl-header.js +299 -299
- package/dist/mcl-header.umd.cjs +1 -1
- package/package.json +11 -11
package/dist/mcl-header.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.nav__decorator[data-v-1b1467b6]:before{content:"";position:absolute;bottom:0;left:0;height:100%;width:0;transition:width .3s linear}.nav__text:focus+.nav__decorator[data-v-1b1467b6]:before,.nav__text:hover+.nav__decorator[data-v-1b1467b6]:before{width:100%}.nav__decorator[data-v-3cd6e9eb]:before{content:"";position:absolute;bottom:0;left:0;height:100%;width:0;transition:width .3s linear}.nav__text:focus+.nav__decorator[data-v-3cd6e9eb]:before,.nav__text:hover+.nav__decorator[data-v-3cd6e9eb]:before{width:100%}.nav__decorator[data-v-94d8fa7b]:before{content:"";position:absolute;bottom:0;left:0;height:100%;width:0;transition:width .3s linear}.nav__text:focus+.nav__decorator[data-v-94d8fa7b]:before,.nav__text:hover+.nav__decorator[data-v-94d8fa7b]:before{width:100%}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
(function(L,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],e):(L=typeof globalThis<"u"?globalThis:L||self,e(L.MclHeader={},L.Vue,L.ManguitoTheme))})(this,function(L,e,t){"use strict";const $=k=>(e.pushScopeId("data-v-1b1467b6"),k=k(),e.popScopeId(),k),S={class:"flex flex-col w-full"},H={class:"self-center"},R=[$(()=>e.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1))],A={class:"relative pt-2xs"},D={class:"relative flex flex-col"},X=["href","target","onClick"],_=e.defineComponent({__name:"NavCollapse",props:{navId:{},navAccordionGroup:{},navItem:{},bgColor:{default:"light-2"},hoverBgColor:{default:"dark-1"},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["child-click","label-click"],setup(k,{emit:T}){const b=k,p=T,f=e.ref(!1),C=e.computed(()=>{const{navId:n}=b;return`nav-${n.toLowerCase().replaceAll(" ","-")}`}),i=e.computed(()=>{const{navAccordionGroup:n}=b;return`accordion-${n.toLocaleLowerCase().replaceAll(" ","-")}`}),d=n=>{f.value=n},u=(n,r)=>{p("label-click",n,r,f.value)},B=(n,r)=>{const{asLink:o}=b;!o&&n.preventDefault(),p("child-click",n,r)},a=(n,r,o)=>{const m=[t("BODYTEXT",n),t("TEXTCOLOR",r)];return o&&m.push("font-bold"),m.join(" ")};return(n,r)=>(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",H,[e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["tracking-wider align-middle outline-none nav__text flex items-center gap-3xs",a(n.menuTextSize,n.menuTextColor,n.menuTextBold)]),onClick:r[0]||(r[0]=o=>u(o,n.navItem.title))},[e.createElementVNode("span",null,e.toDisplayString(n.navItem.title),1),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:e.normalizeClass(["h-[0.8rem] fill-current",[f.value?"rotate-180":"rotate-0","transition-transform duration-300 ease-in"]])},R,2))],2)),[[e.unref(t.vCollapse),void 0,C.value]]),n.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["relative -top-[2px] h-[6px] nav__decorator",e.unref(t)("BEFOREBG",n.highlightColor)])},null,2)):e.createCommentVNode("",!0)]),e.createVNode(e.unref(t.Collapse),{id:C.value,visible:!1,accordion:i.value,onOpen:d,onClose:d},{default:e.withCtx(()=>[e.createElementVNode("div",A,[n.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute w-md bg-opacity-25 -left-4 h-full",e.unref(t)("BGCOLOR",n.highlightColor)])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.navItem.children,(o,m)=>(e.openBlock(),e.createElementBlock("a",{href:o.url,target:o.target,class:e.normalizeClass(["w-full pb-2xs last:pb-0",[e.unref(t)("TEXTCOLOR",n.menuTextColor),e.unref(t)("BODYTEXT",n.menuTextSize)]]),key:m,onClick:g=>B(g,o)},e.toDisplayString(o.title),11,X))),128))])])]),_:1},8,["id","accordion"])]))}}),I=(k,T)=>{const b=k.__vccOpts||k;for(const[p,f]of T)b[p]=f;return b},M=I(_,[["__scopeId","data-v-1b1467b6"]]),j=k=>(e.pushScopeId("data-v-3cd6e9eb"),k=k(),e.popScopeId(),k),F=["onClick"],G=[j(()=>e.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1))],K=["href","target","onClick"],Y=I(e.defineComponent({__name:"NavDropdown",props:{navItem:{},bgColor:{default:"light-1"},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["label-click","child-click"],setup(k,{emit:T}){const b=k,p=T,f=e.ref(-1),C=e.ref(),i=(a,n,r)=>{const o=[t("BODYTEXT",a),t("TEXTCOLOR",n)];return r&&o.push("font-bold"),o.join(" ")},d=a=>{const n=b.navItem.children.length;C.value!==void 0&&(a==="down"&&f.value<n-1&&f.value++,a==="up"&&f.value>0&&f.value--,C.value[f.value].focus())},u=(a,n,r)=>{f.value=-1,p("label-click",a,n,r)},B=(a,n)=>{const{asLink:r}=b;!r&&a.preventDefault(),p("child-click",a,n)};return(a,n)=>(e.openBlock(),e.createElementBlock("div",{onKeyup:[n[0]||(n[0]=e.withKeys(r=>d("down"),["down"])),n[1]||(n[1]=e.withKeys(r=>d("up"),["up"]))]},[e.createVNode(e.unref(t.DropdownContainer),null,{toggler:e.withCtx(({toggle:r,dropdownState:o})=>[e.createElementVNode("div",null,[e.createElementVNode("button",{class:e.normalizeClass(["tracking-wider align-middle outline-none nav__text flex items-center gap-3xs",i(a.menuTextSize,a.menuTextColor,a.menuTextBold)]),onClick:m=>(r(m),u(m,a.navItem.title,o))},[e.createElementVNode("span",null,e.toDisplayString(a.navItem.title),1),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:e.normalizeClass(["h-[0.8rem] fill-current",[o?"rotate-180":"rotate-0","transition-transform duration-300 ease-in"]])},G,2))],10,F),a.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["relative -top-[2px] h-[6px] nav__decorator",e.unref(t)("BEFOREBG",a.highlightColor)])},null,2)):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createVNode(e.unref(t.DropdownContent),{className:"border drop-shadow-sm"},{default:e.withCtx(({itemClick:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.navItem.children,(o,m)=>(e.openBlock(),e.createElementBlock("a",{href:o.url,target:o.target,key:m,ref_for:!0,ref_key:"navItemRef",ref:C,class:e.normalizeClass(["px-xs py-2xs block w-full hover:bg-opacity-50 focus:bg-opacity-50 transition-all duration-200 ease-linear",[e.unref(t)("BGCOLOR",a.bgColor),e.unref(t)("HVBGCOLOR",a.highlightColor),e.unref(t)("FCBGCOLOR",a.highlightColor),e.unref(t)("TEXTCOLOR",a.menuTextColor),e.unref(t)("BODYTEXT",a.menuTextSize)]]),onClick:g=>(r(),B(g,o))},e.toDisplayString(o.title),11,K))),128))]),_:1})]),_:1})],32))}}),[["__scopeId","data-v-3cd6e9eb"]]),q=["href","target","innerHTML"],x=I(e.defineComponent({__name:"NavLink",props:{navItem:{},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["nav-link"],setup(k,{emit:T}){const b=k,p=T,f=(i,d,u)=>{const B=[t("BODYTEXT",i),t("TEXTCOLOR",d)];return u&&B.push("font-bold"),B.join(" ")},C=(i,d)=>{const{asLink:u}=b;!u&&i.preventDefault(),p("nav-link",i,d)};return(i,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("a",{href:i.navItem.url,target:i.navItem.target,innerHTML:i.navItem.title,class:e.normalizeClass(["tracking-wider outline-none nav__text",f(i.menuTextSize,i.menuTextColor,i.menuTextBold)]),onClick:d[0]||(d[0]=u=>C(u,i.navItem))},null,10,q),i.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["relative -top-[2px] h-[6px] nav__decorator",e.unref(t)("BEFOREBG",i.highlightColor)])},null,2)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-94d8fa7b"]]),W={class:"flex flex-shrink-0 items-center self-center"},P={class:"h-md md:h-lg lg:h-xl mr-2xs md:mr-sm align-middle"},U=["href","target"],J=["src","alt"],Q=["src","alt"],Z={class:"flex flex-col justify-center ml-2"},v=["href","target"],ee=["innerHTML"],le={class:"hidden lg:flex flex-wrap"},oe={key:0,class:"hidden lg:block"},te={class:"flex flex-col items-center justify-center p-xs"},ne={key:0},ie=e.defineComponent({__name:"MclHeaderA",props:{logo:{},logoSmall:{},logoAlt:{default:""},title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},titleBlockAsLink:{type:Boolean,default:!1},titleBlockLinkTarget:{default:"_self"},titleBlockLink:{},menuItems:{},menuItemAsLink:{type:Boolean,default:!1},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},bgColor:{default:"light-1"},mobileMenuBgColor:{default:"light-2"},drawerBtnColor:{default:"dark-1"},drawerBtnBorder:{type:Boolean,default:!0},fadeInOnScroll:{type:Boolean,default:!0},scrollDistance:{default:50}},emits:["toggle-drawer","title-click","menu-click","collapse-click"],setup(k,{expose:T,emit:b}){const p=k,f=e.ref(),C=e.useSlots(),i=b,d=()=>{var o;(o=f.value)==null||o.headerClose()},u=o=>{const{titleBlockAsLink:m,titleBlockLink:g,titleBlockLinkTarget:l}=p;m||o.preventDefault(),i("title-click",o,g,l),d()},B=(o,m)=>{const{menuItemAsLink:g}=p;g||o.preventDefault(),i("menu-click",o,m),d()},a=(o,m,g)=>{i("collapse-click",o,m,g)},n=(o,m)=>[t("H2",o),t("TEXTCOLOR",m)].join(" "),r=o=>{const m=o;return typeof m.children>"u"?!1:m.children.length>0};return T({headerClose:d}),(o,m)=>(e.openBlock(),e.createBlock(e.unref(t.HeaderHorizontal),{ref_key:"componentRef",ref:f,"bg-color":o.bgColor,"drawer-btn-border":o.drawerBtnBorder,"drawer-btn-color":o.drawerBtnColor,"fade-in-on-scroll":o.fadeInOnScroll,"mobile-menu-bg-color":o.mobileMenuBgColor},{content:e.withCtx(()=>[e.createElementVNode("div",W,[e.createElementVNode("div",P,[e.createElementVNode("a",{href:o.titleBlockLink,target:o.titleBlockLinkTarget,onClick:u},[e.createElementVNode("img",{src:o.logo,alt:o.logoAlt,class:e.normalizeClass(["h-full",[o.logoSmall?"hidden lg:inline-block":"inline-block"]])},null,10,J),o.logoSmall?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.logoSmall,alt:o.logoAlt,class:"inline-block lg:hidden h-full"},null,8,Q)):e.createCommentVNode("",!0)],8,U)]),e.createElementVNode("div",Z,[e.createElementVNode("a",{href:o.titleBlockLink,target:o.titleBlockLinkTarget,onClick:u},[e.createElementVNode("h2",{class:e.normalizeClass(["inline-block align-middle tracking-wider",n(o.titleSize,o.titleColor)]),innerHTML:o.title},null,10,ee)],8,v),e.createElementVNode("ul",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menuItems,(g,l)=>(e.openBlock(),e.createElementBlock("li",{class:"mr-xs last:mr-0",key:`menu-${l}`},[r(g)?(e.openBlock(),e.createBlock(Y,{key:1,"nav-item":g,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"bg-color":o.bgColor,"as-link":o.menuItemAsLink,onChildClick:B,onLabelClick:a},null,8,["nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","bg-color","as-link"])):(e.openBlock(),e.createBlock(x,{key:0,"nav-item":g,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"as-link":o.menuItemAsLink,onNavLink:B},null,8,["nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","as-link"]))]))),128))])])])]),"content-right":e.withCtx(()=>[C["content-right"]?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(o.$slots,"content-right")])):e.createCommentVNode("",!0)]),"mobile-content":e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("ul",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menuItems,(g,l)=>(e.openBlock(),e.createElementBlock("li",{class:"mb-2xs last:mb-0",key:`mobile-${l}`},[r(g)?(e.openBlock(),e.createBlock(M,{key:1,"nav-id":g.title,"nav-item":g,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"nav-accordion-group":o.title,"as-link":o.menuItemAsLink,onChildClick:B,onLabelClick:a},null,8,["nav-id","nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","nav-accordion-group","as-link"])):(e.openBlock(),e.createBlock(x,{key:0,"nav-item":g,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"as-link":o.menuItemAsLink,onNavLink:B},null,8,["nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","as-link"]))]))),128))]),C["mobile-bottom"]?(e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(o.$slots,"mobile-bottom",{headerClose:d})])):e.createCommentVNode("",!0)])]),_:3},8,["bg-color","drawer-btn-border","drawer-btn-color","fade-in-on-scroll","mobile-menu-bg-color"]))}}),re={class:"relative flex gap-2 items-center justify-center"},ae=[e.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)],se=["href","target","onClick"],ce={class:"relative"},z=e.defineComponent({__name:"NavCollapseVertical",props:{navId:{},navAccordionGroup:{},navLocation:{},menuItem:{},textColor:{default:"dark-3"},textSize:{default:"md"},fontBold:{type:Boolean,default:!1},dHl:{type:Boolean,default:!0},hlColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["label-click","child-click"],setup(k,{expose:T,emit:b}){const p=k,f=e.ref(!1),C=e.ref(),i=b,d=l=>{f.value=l},u=()=>{var l;(l=C.value)==null||l.close()},B=(l,c)=>{i("label-click",l,c,f.value)},a=(l,c)=>{var h;const{asLink:s}=p;s||l.preventDefault(),i("child-click",l,c),(h=C.value)==null||h.close(),u()},n=e.computed(()=>{const{navId:l,navLocation:c}=p,h=l.toLowerCase().replaceAll(" ","-");return`nav-${c}-${h}`}),r=e.computed(()=>{const{navAccordionGroup:l,navLocation:c}=p,s=l.toLowerCase().replaceAll(" ","-");return`nav-accordion-group-${c}-${s}`}),o=e.computed(()=>{const{textColor:l,textSize:c,dHl:s,hlColor:h,fontBold:E}=p,y=[t("BODYTEXT",c)];if(!s){const O=[t("TEXTCOLOR",l),t("HVTEXTCOLOR",h),t("FCTEXTCOLOR",h)];y.push(O.join(" "))}if(s){const O=t("BEFOREBG",h);y.push("before:inset-y-0 before:left-0 before:transition-[width] before:duration-300 before:ease-linear before:w-0 hover:before:w-full focus:before:w-full "+O);const N=[t("TEXTCOLOR",h),t("HVTEXTCOLOR",l),t("FCTEXTCOLOR",l)];y.push(N.join(" "))}return E&&y.push("font-bold"),y.join(" ")}),m=e.computed(()=>{const{dHl:l,hlColor:c,navLocation:s}=p,h=[];if(!l)return"";const E="before:absolute before:w-xs before:h-full before:bg-primary before:bg-opacity-70 ",y=s==="desktop"?"before:left-0 ":"before:right-0 ";return h.push(E+y+t("BEFOREBG",c)),h.join(" ")}),g=e.computed(()=>{const{textColor:l,textSize:c,dHl:s,hlColor:h,fontBold:E,navLocation:y}=p;let O=c==="xl"?"lg":c==="lg"?"md":c==="md"?"sm":"xs";const w=[t("TEXTCOLOR",l),t("BODYTEXT",O)];if(y==="mobile"&&w.push("text-end"),!s){const N=[t("TEXTCOLOR",l),t("HVTEXTCOLOR",h),t("FCTEXTCOLOR",h)];w.push(N.join(" "))}if(s){const N=t("BEFOREBG",h),Ie="before:inset-y-0 before:duration-300 before:ease-linear before:w-0 hover:before:w-full focus:before:w-full before:bg-opacity-70 ",xe=y==="desktop"?"before:left-0 before:transition-[width] ":"before:left-full hover:before:left-0 focus:before:left-0 before:transition-[all] ";w.push(Ie+xe+N);const ze=[t("TEXTCOLOR",h),t("HVTEXTCOLOR",l),t("FCTEXTCOLOR",l)];w.push(ze.join(" "))}return E&&w.push("font-bold"),w.join(" ")});return T({closeCollapse:u}),(l,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-xs py-2xs relative text-center block w-full before:absolute transition-colors duration-300 ease-linear",[o.value]]),onClick:c[0]||(c[0]=s=>B(s,l.menuItem.title))},[e.createElementVNode("div",re,[e.createElementVNode("span",null,e.toDisplayString(l.menuItem.title),1),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:e.normalizeClass(["h-[0.8rem] fill-current",[f.value?"rotate-180":"rotate-0","transition-transform duration-300 ease-in"]])},ae,2))])],2)),[[e.unref(t.vCollapse),void 0,n.value]]),e.createVNode(e.unref(t.Collapse),{ref_key:"collapseRef",ref:C,id:n.value,accordion:r.value,onOpen:d,onClose:d},{default:e.withCtx(()=>[e.createElementVNode("ul",{class:e.normalizeClass(["relative",[m.value]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.menuItem.children,(s,h)=>(e.openBlock(),e.createElementBlock("li",{key:h,class:e.normalizeClass([l.navLocation==="desktop"?"ml-xs":"mr-xs"])},[e.createElementVNode("a",{href:s.url,target:s.target,onClick:E=>a(E,s),class:e.normalizeClass(["relative before:absolute w-full px-2xs py-3xs block overflow-x-hidden transition-colors duration-300 ease-linear",[g.value]])},[e.createElementVNode("span",ce,e.toDisplayString(s.title),1)],10,se)],2))),128))],2)]),_:1},8,["id","accordion"])]))}}),de=["href","target"],me={class:"relative"},V=e.defineComponent({__name:"NavLinkVertical",props:{menuItem:{},textColor:{default:"dark-3"},textSize:{default:"md"},fontBold:{type:Boolean,default:!1},dHl:{type:Boolean,default:!0},hlColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["menu-click"],setup(k,{emit:T}){const b=k,p=T,f=(i,d)=>{const{asLink:u}=b;u||i.preventDefault(),p("menu-click",i,d)},C=e.computed(()=>{const{textColor:i,textSize:d,dHl:u,hlColor:B,fontBold:a}=b,n=[t("BODYTEXT",d)];if(!u){const r=[t("TEXTCOLOR",i),t("HVTEXTCOLOR",B),t("FCTEXTCOLOR",B)];n.push(r.join(" "))}if(u){const r=t("BEFOREBG",B);n.push("before:inset-y-0 before:left-0 before:transition-[width] before:duration-300 before:ease-linear before:w-0 hover:before:w-full focus:before:w-full "+r);const m=[t("TEXTCOLOR",B),t("HVTEXTCOLOR",i),t("FCTEXTCOLOR",i)];n.push(m.join(" "))}return a&&n.push("font-bold"),n.join(" ")});return(i,d)=>(e.openBlock(),e.createElementBlock("a",{class:e.normalizeClass([[C.value],"px-xs py-2xs relative text-center block w-full before:absolute transition-colors duration-300 ease-linear"]),href:i.menuItem.url,target:i.menuItem.target?i.menuItem.target:"_self",onClick:d[0]||(d[0]=u=>f(u,i.menuItem))},[e.createElementVNode("span",me,e.toDisplayString(i.menuItem.title),1)],10,de))}}),he={class:"p-md text-center"},fe=["href","target"],pe=["src","alt"],ke=["href","target"],ue=["innerHTML"],ge={class:"flex flex-col"},Ce={key:0},Be={class:"flex flex-col justify-between h-full"},be={class:"p-md text-center"},Te=["href","target"],ye=["src","alt"],Le=["href","target"],Ee=["innerHTML"],we={class:"flex flex-col"},Oe={key:0},Ne=e.defineComponent({__name:"MclHeaderB",props:{logo:{},logoAlt:{default:""},title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},titleBlockAsLink:{type:Boolean,default:!1},titleBlockLinkTarget:{default:"_self"},titleBlockLink:{},menuItems:{},menuItemAsLink:{type:Boolean,default:!1},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},bgColor:{default:"light-1"},drawerBtnColor:{default:"dark-1"},drawerBtnBorder:{type:Boolean,default:!0},headerWidth:{default:160}},emits:["toggle-drawer","title-click","menu-click","collapse-click"],setup(k,{expose:T,emit:b}){const p=k,f=e.useSlots(),C=b,i=e.ref(),d=e.ref(),u=(l,c)=>{C("toggle-drawer",l,c)},B=()=>{var l;(l=i.value)==null||l.headerClose()},a=()=>{for(let l=0;l<d.value.length;l++)d.value[l].closeCollapse()},n=l=>{const{titleBlockAsLink:c,titleBlockLink:s,titleBlockLinkTarget:h}=p;c||l.preventDefault(),C("title-click",l,s,h),B(),a()},r=(l,c)=>{const{menuItemAsLink:s}=p;s||l.preventDefault(),C("menu-click",l,c),B(),a()},o=(l,c,s)=>{C("collapse-click",l,c,s)},m=e.computed(()=>{const{titleSize:l,titleColor:c}=p;return[t("H3",l),t("TEXTCOLOR",c)].join(" ")}),g=l=>{const c=l;return typeof c.children>"u"?!1:c.children.length>0};return T({headerClose:B}),(l,c)=>(e.openBlock(),e.createBlock(e.unref(t.HeaderVertical),{"bg-color":l.bgColor,"drawer-btn-color":l.drawerBtnColor,"drawer-btn-border":l.drawerBtnBorder,"header-width":l.headerWidth,onToggleDrawer:u,ref_key:"componentRef",ref:i},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),content:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("div",he,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:n},[e.createElementVNode("img",{src:l.logo,alt:l.logoAlt,class:"h-full inline-block max-h-xl"},null,8,pe)],8,fe)]),e.createElementVNode("div",null,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:n},[e.createElementVNode("h3",{class:e.normalizeClass([m.value,"text-center mb-md"]),innerHTML:l.title},null,10,ue)],8,ke)]),e.createElementVNode("ul",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.menuItems,(s,h)=>(e.openBlock(),e.createElementBlock("li",{key:`menu-${h}`},[g(s)?(e.openBlock(),e.createBlock(z,{key:1,ref_for:!0,ref_key:"collapseRef",ref:d,"nav-id":s.title,"nav-location":"desktop","nav-accordion-group":l.title,"menu-item":s,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onChildClick:r,onLabelClick:o},null,8,["nav-id","nav-accordion-group","menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"])):(e.openBlock(),e.createBlock(V,{key:0,"menu-item":s,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onMenuClick:r},null,8,["menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"]))]))),128))])])]),"content-bottom":e.withCtx(()=>[f["content-bottom"]?(e.openBlock(),e.createElementBlock("div",Ce,[e.renderSlot(l.$slots,"content-bottom")])):e.createCommentVNode("",!0)]),"mobile-content":e.withCtx(({headerClose:s})=>[e.createElementVNode("div",Be,[e.createElementVNode("div",null,[e.createElementVNode("div",be,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:n},[e.createElementVNode("img",{src:l.logo,alt:l.logoAlt,class:"h-full inline-block max-h-xl"},null,8,ye)],8,Te)]),e.createElementVNode("div",null,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:n},[e.createElementVNode("h3",{class:e.normalizeClass([m.value,"text-center mb-md"]),innerHTML:l.title},null,10,Ee)],8,Le)]),e.createElementVNode("ul",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.menuItems,(h,E)=>(e.openBlock(),e.createElementBlock("li",{key:`menu-${E}`},[g(h)?(e.openBlock(),e.createBlock(z,{key:1,"nav-id":h.title,"nav-location":"mobile","nav-accordion-group":l.title,"menu-item":h,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onChildClick:r,onLabelClick:o},null,8,["nav-id","nav-accordion-group","menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"])):(e.openBlock(),e.createBlock(V,{key:0,"menu-item":h,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onMenuClick:r},null,8,["menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"]))]))),128))])]),f["mobile-bottom"]?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"mobile-bottom",{headerClose:s})])):e.createCommentVNode("",!0)])]),_:3},8,["bg-color","drawer-btn-color","drawer-btn-border","header-width"]))}});L.MclHeaderA=ie,L.MclHeaderB=Ne,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
(function(L,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],e):(L=typeof globalThis<"u"?globalThis:L||self,e(L.MclHeader={},L.Vue,L.ManguitoTheme))})(this,function(L,e,n){"use strict";const H={class:"flex flex-col w-full"},$={class:"self-center"},R={class:"relative pt-2xs"},S={class:"relative flex flex-col"},A=["href","target","onClick"],D=e.defineComponent({__name:"NavCollapse",props:{navId:{},navAccordionGroup:{},navItem:{},bgColor:{default:"light-2"},hoverBgColor:{default:"dark-1"},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["child-click","label-click"],setup(b,{emit:T}){const B=b,k=T,f=e.ref(!1),g=e.computed(()=>{const{navId:t}=B;return`nav-${t.toLowerCase().replaceAll(" ","-")}`}),i=e.computed(()=>{const{navAccordionGroup:t}=B;return`accordion-${t.toLocaleLowerCase().replaceAll(" ","-")}`}),d=t=>{f.value=t},p=(t,r)=>{k("label-click",t,r,f.value)},C=(t,r)=>{const{asLink:o}=B;!o&&t.preventDefault(),k("child-click",t,r)},a=(t,r,o)=>{const m=[n("BODYTEXT",t),n("TEXTCOLOR",r)];return o&&m.push("font-bold"),m.join(" ")};return(t,r)=>(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",$,[e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["tracking-wider align-middle outline-none nav__text flex items-center gap-3xs",a(t.menuTextSize,t.menuTextColor,t.menuTextBold)]),onClick:r[0]||(r[0]=o=>p(o,t.navItem.title))},[e.createElementVNode("span",null,e.toDisplayString(t.navItem.title),1),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:e.normalizeClass(["h-[0.8rem] fill-current",[f.value?"rotate-180":"rotate-0","transition-transform duration-300 ease-in"]])},r[1]||(r[1]=[e.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)]),2))],2)),[[e.unref(n.vCollapse),void 0,g.value]]),t.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["relative -top-[2px] h-[6px] nav__decorator",e.unref(n)("BEFOREBG",t.highlightColor)])},null,2)):e.createCommentVNode("",!0)]),e.createVNode(e.unref(n.Collapse),{id:g.value,visible:!1,accordion:i.value,onOpen:d,onClose:d},{default:e.withCtx(()=>[e.createElementVNode("div",R,[t.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute w-md bg-opacity-25 -left-4 h-full",e.unref(n)("BGCOLOR",t.highlightColor)])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.navItem.children,(o,m)=>(e.openBlock(),e.createElementBlock("a",{href:o.url,target:o.target,class:e.normalizeClass(["w-full pb-2xs last:pb-0",[e.unref(n)("TEXTCOLOR",t.menuTextColor),e.unref(n)("BODYTEXT",t.menuTextSize)]]),key:m,onClick:u=>C(u,o)},e.toDisplayString(o.title),11,A))),128))])])]),_:1},8,["id","accordion"])]))}}),x=(b,T)=>{const B=b.__vccOpts||b;for(const[k,f]of T)B[k]=f;return B},X=x(D,[["__scopeId","data-v-1b1467b6"]]),M=["onClick"],j=["href","target","onClick"],F=x(e.defineComponent({__name:"NavDropdown",props:{navItem:{},bgColor:{default:"light-1"},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["label-click","child-click"],setup(b,{emit:T}){const B=b,k=T,f=e.ref(-1),g=e.ref(),i=(a,t,r)=>{const o=[n("BODYTEXT",a),n("TEXTCOLOR",t)];return r&&o.push("font-bold"),o.join(" ")},d=a=>{const t=B.navItem.children.length;g.value!==void 0&&(a==="down"&&f.value<t-1&&f.value++,a==="up"&&f.value>0&&f.value--,g.value[f.value].focus())},p=(a,t,r)=>{f.value=-1,k("label-click",a,t,r)},C=(a,t)=>{const{asLink:r}=B;!r&&a.preventDefault(),k("child-click",a,t)};return(a,t)=>(e.openBlock(),e.createElementBlock("div",{onKeyup:[t[0]||(t[0]=e.withKeys(r=>d("down"),["down"])),t[1]||(t[1]=e.withKeys(r=>d("up"),["up"]))]},[e.createVNode(e.unref(n.DropdownContainer),null,{toggler:e.withCtx(({toggle:r,dropdownState:o})=>[e.createElementVNode("div",null,[e.createElementVNode("button",{class:e.normalizeClass(["tracking-wider align-middle outline-none nav__text flex items-center gap-3xs",i(a.menuTextSize,a.menuTextColor,a.menuTextBold)]),onClick:m=>(r(m),p(m,a.navItem.title,o))},[e.createElementVNode("span",null,e.toDisplayString(a.navItem.title),1),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:e.normalizeClass(["h-[0.8rem] fill-current",[o?"rotate-180":"rotate-0","transition-transform duration-300 ease-in"]])},t[2]||(t[2]=[e.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)]),2))],10,M),a.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["relative -top-[2px] h-[6px] nav__decorator",e.unref(n)("BEFOREBG",a.highlightColor)])},null,2)):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createVNode(e.unref(n.DropdownContent),{className:"border drop-shadow-sm"},{default:e.withCtx(({itemClick:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.navItem.children,(o,m)=>(e.openBlock(),e.createElementBlock("a",{href:o.url,target:o.target,key:m,ref_for:!0,ref_key:"navItemRef",ref:g,class:e.normalizeClass(["px-xs py-2xs block w-full hover:bg-opacity-50 focus:bg-opacity-50 transition-all duration-200 ease-linear",[e.unref(n)("BGCOLOR",a.bgColor),e.unref(n)("HVBGCOLOR",a.highlightColor),e.unref(n)("FCBGCOLOR",a.highlightColor),e.unref(n)("TEXTCOLOR",a.menuTextColor),e.unref(n)("BODYTEXT",a.menuTextSize)]]),onClick:u=>(r(),C(u,o))},e.toDisplayString(o.title),11,j))),128))]),_:1})]),_:1})],32))}}),[["__scopeId","data-v-3cd6e9eb"]]),G=["href","target","innerHTML"],z=x(e.defineComponent({__name:"NavLink",props:{navItem:{},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["nav-link"],setup(b,{emit:T}){const B=b,k=T,f=(i,d,p)=>{const C=[n("BODYTEXT",i),n("TEXTCOLOR",d)];return p&&C.push("font-bold"),C.join(" ")},g=(i,d)=>{const{asLink:p}=B;!p&&i.preventDefault(),k("nav-link",i,d)};return(i,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("a",{href:i.navItem.url,target:i.navItem.target,innerHTML:i.navItem.title,class:e.normalizeClass(["tracking-wider outline-none nav__text",f(i.menuTextSize,i.menuTextColor,i.menuTextBold)]),onClick:d[0]||(d[0]=p=>g(p,i.navItem))},null,10,G),i.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["relative -top-[2px] h-[6px] nav__decorator",e.unref(n)("BEFOREBG",i.highlightColor)])},null,2)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-94d8fa7b"]]),K={class:"flex flex-shrink-0 items-center self-center"},Y={class:"h-md md:h-lg lg:h-xl mr-2xs md:mr-sm align-middle"},_=["href","target"],q=["src","alt"],W=["src","alt"],P={class:"flex flex-col justify-center ml-2"},U=["href","target"],J=["innerHTML"],Q={class:"hidden lg:flex flex-wrap"},Z={key:0,class:"hidden lg:block"},v={class:"flex flex-col items-center justify-center p-xs"},ee={key:0},le=e.defineComponent({__name:"MclHeaderA",props:{logo:{},logoSmall:{},logoAlt:{default:""},title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},titleBlockAsLink:{type:Boolean,default:!1},titleBlockLinkTarget:{default:"_self"},titleBlockLink:{},menuItems:{},menuItemAsLink:{type:Boolean,default:!1},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},bgColor:{default:"light-1"},mobileMenuBgColor:{default:"light-2"},drawerBtnColor:{default:"dark-1"},drawerBtnBorder:{type:Boolean,default:!0},fadeInOnScroll:{type:Boolean,default:!0},scrollDistance:{default:50}},emits:["toggle-drawer","title-click","menu-click","collapse-click"],setup(b,{expose:T,emit:B}){const k=b,f=e.ref(),g=e.useSlots(),i=B,d=()=>{var o;(o=f.value)==null||o.headerClose()},p=o=>{const{titleBlockAsLink:m,titleBlockLink:u,titleBlockLinkTarget:l}=k;m||o.preventDefault(),i("title-click",o,u,l),d()},C=(o,m)=>{const{menuItemAsLink:u}=k;u||o.preventDefault(),i("menu-click",o,m),d()},a=(o,m,u)=>{i("collapse-click",o,m,u)},t=(o,m)=>[n("H2",o),n("TEXTCOLOR",m)].join(" "),r=o=>{const m=o;return typeof m.children>"u"?!1:m.children.length>0};return T({headerClose:d}),(o,m)=>(e.openBlock(),e.createBlock(e.unref(n.HeaderHorizontal),{ref_key:"componentRef",ref:f,"bg-color":o.bgColor,"drawer-btn-border":o.drawerBtnBorder,"drawer-btn-color":o.drawerBtnColor,"fade-in-on-scroll":o.fadeInOnScroll,"mobile-menu-bg-color":o.mobileMenuBgColor},{content:e.withCtx(()=>[e.createElementVNode("div",K,[e.createElementVNode("div",Y,[e.createElementVNode("a",{href:o.titleBlockLink,target:o.titleBlockLinkTarget,onClick:p},[e.createElementVNode("img",{src:o.logo,alt:o.logoAlt,class:e.normalizeClass(["h-full",[o.logoSmall?"hidden lg:inline-block":"inline-block"]])},null,10,q),o.logoSmall?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.logoSmall,alt:o.logoAlt,class:"inline-block lg:hidden h-full"},null,8,W)):e.createCommentVNode("",!0)],8,_)]),e.createElementVNode("div",P,[e.createElementVNode("a",{href:o.titleBlockLink,target:o.titleBlockLinkTarget,onClick:p},[e.createElementVNode("h2",{class:e.normalizeClass(["inline-block align-middle tracking-wider",t(o.titleSize,o.titleColor)]),innerHTML:o.title},null,10,J)],8,U),e.createElementVNode("ul",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menuItems,(u,l)=>(e.openBlock(),e.createElementBlock("li",{class:"mr-xs last:mr-0",key:`menu-${l}`},[r(u)?(e.openBlock(),e.createBlock(F,{key:1,"nav-item":u,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"bg-color":o.bgColor,"as-link":o.menuItemAsLink,onChildClick:C,onLabelClick:a},null,8,["nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","bg-color","as-link"])):(e.openBlock(),e.createBlock(z,{key:0,"nav-item":u,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"as-link":o.menuItemAsLink,onNavLink:C},null,8,["nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","as-link"]))]))),128))])])])]),"content-right":e.withCtx(()=>[g["content-right"]?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(o.$slots,"content-right")])):e.createCommentVNode("",!0)]),"mobile-content":e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("ul",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menuItems,(u,l)=>(e.openBlock(),e.createElementBlock("li",{class:"mb-2xs last:mb-0",key:`mobile-${l}`},[r(u)?(e.openBlock(),e.createBlock(X,{key:1,"nav-id":u.title,"nav-item":u,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"nav-accordion-group":o.title,"as-link":o.menuItemAsLink,onChildClick:C,onLabelClick:a},null,8,["nav-id","nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","nav-accordion-group","as-link"])):(e.openBlock(),e.createBlock(z,{key:0,"nav-item":u,"menu-text-color":o.menuTextColor,"menu-text-size":o.menuTextSize,"menu-text-bold":o.menuTextBold,"display-highlight":o.displayHighlight,"highlight-color":o.highlightColor,"as-link":o.menuItemAsLink,onNavLink:C},null,8,["nav-item","menu-text-color","menu-text-size","menu-text-bold","display-highlight","highlight-color","as-link"]))]))),128))]),g["mobile-bottom"]?(e.openBlock(),e.createElementBlock("div",ee,[e.renderSlot(o.$slots,"mobile-bottom",{headerClose:d})])):e.createCommentVNode("",!0)])]),_:3},8,["bg-color","drawer-btn-border","drawer-btn-color","fade-in-on-scroll","mobile-menu-bg-color"]))}}),oe={class:"relative flex gap-2 items-center justify-center"},te=["href","target","onClick"],ne={class:"relative"},V=e.defineComponent({__name:"NavCollapseVertical",props:{navId:{},navAccordionGroup:{},navLocation:{},menuItem:{},textColor:{default:"dark-3"},textSize:{default:"md"},fontBold:{type:Boolean,default:!1},dHl:{type:Boolean,default:!0},hlColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["label-click","child-click"],setup(b,{expose:T,emit:B}){const k=b,f=e.ref(!1),g=e.ref(),i=B,d=l=>{f.value=l},p=()=>{var l;(l=g.value)==null||l.close()},C=(l,s)=>{i("label-click",l,s,f.value)},a=(l,s)=>{var h;const{asLink:c}=k;c||l.preventDefault(),i("child-click",l,s),(h=g.value)==null||h.close(),p()},t=e.computed(()=>{const{navId:l,navLocation:s}=k,h=l.toLowerCase().replaceAll(" ","-");return`nav-${s}-${h}`}),r=e.computed(()=>{const{navAccordionGroup:l,navLocation:s}=k,c=l.toLowerCase().replaceAll(" ","-");return`nav-accordion-group-${s}-${c}`}),o=e.computed(()=>{const{textColor:l,textSize:s,dHl:c,hlColor:h,fontBold:E}=k,y=[n("BODYTEXT",s)];if(!c){const O=[n("TEXTCOLOR",l),n("HVTEXTCOLOR",h),n("FCTEXTCOLOR",h)];y.push(O.join(" "))}if(c){const O=n("BEFOREBG",h);y.push("before:inset-y-0 before:left-0 before:transition-[width] before:duration-300 before:ease-linear before:w-0 hover:before:w-full focus:before:w-full "+O);const N=[n("TEXTCOLOR",h),n("HVTEXTCOLOR",l),n("FCTEXTCOLOR",l)];y.push(N.join(" "))}return E&&y.push("font-bold"),y.join(" ")}),m=e.computed(()=>{const{dHl:l,hlColor:s,navLocation:c}=k,h=[];if(!l)return"";const E="before:absolute before:w-xs before:h-full before:bg-primary before:bg-opacity-70 ",y=c==="desktop"?"before:left-0 ":"before:right-0 ";return h.push(E+y+n("BEFOREBG",s)),h.join(" ")}),u=e.computed(()=>{const{textColor:l,textSize:s,dHl:c,hlColor:h,fontBold:E,navLocation:y}=k;let O=s==="xl"?"lg":s==="lg"?"md":s==="md"?"sm":"xs";const w=[n("TEXTCOLOR",l),n("BODYTEXT",O)];if(y==="mobile"&&w.push("text-end"),!c){const N=[n("TEXTCOLOR",l),n("HVTEXTCOLOR",h),n("FCTEXTCOLOR",h)];w.push(N.join(" "))}if(c){const N=n("BEFOREBG",h),Le="before:inset-y-0 before:duration-300 before:ease-linear before:w-0 hover:before:w-full focus:before:w-full before:bg-opacity-70 ",Ee=y==="desktop"?"before:left-0 before:transition-[width] ":"before:left-full hover:before:left-0 focus:before:left-0 before:transition-[all] ";w.push(Le+Ee+N);const we=[n("TEXTCOLOR",h),n("HVTEXTCOLOR",l),n("FCTEXTCOLOR",l)];w.push(we.join(" "))}return E&&w.push("font-bold"),w.join(" ")});return T({closeCollapse:p}),(l,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-xs py-2xs relative text-center block w-full before:absolute transition-colors duration-300 ease-linear",[o.value]]),onClick:s[0]||(s[0]=c=>C(c,l.menuItem.title))},[e.createElementVNode("div",oe,[e.createElementVNode("span",null,e.toDisplayString(l.menuItem.title),1),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:e.normalizeClass(["h-[0.8rem] fill-current",[f.value?"rotate-180":"rotate-0","transition-transform duration-300 ease-in"]])},s[1]||(s[1]=[e.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)]),2))])],2)),[[e.unref(n.vCollapse),void 0,t.value]]),e.createVNode(e.unref(n.Collapse),{ref_key:"collapseRef",ref:g,id:t.value,accordion:r.value,onOpen:d,onClose:d},{default:e.withCtx(()=>[e.createElementVNode("ul",{class:e.normalizeClass(["relative",[m.value]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.menuItem.children,(c,h)=>(e.openBlock(),e.createElementBlock("li",{key:h,class:e.normalizeClass([l.navLocation==="desktop"?"ml-xs":"mr-xs"])},[e.createElementVNode("a",{href:c.url,target:c.target,onClick:E=>a(E,c),class:e.normalizeClass(["relative before:absolute w-full px-2xs py-3xs block overflow-x-hidden transition-colors duration-300 ease-linear",[u.value]])},[e.createElementVNode("span",ne,e.toDisplayString(c.title),1)],10,te)],2))),128))],2)]),_:1},8,["id","accordion"])]))}}),ie=["href","target"],re={class:"relative"},I=e.defineComponent({__name:"NavLinkVertical",props:{menuItem:{},textColor:{default:"dark-3"},textSize:{default:"md"},fontBold:{type:Boolean,default:!1},dHl:{type:Boolean,default:!0},hlColor:{default:"primary"},asLink:{type:Boolean,default:!0}},emits:["menu-click"],setup(b,{emit:T}){const B=b,k=T,f=(i,d)=>{const{asLink:p}=B;p||i.preventDefault(),k("menu-click",i,d)},g=e.computed(()=>{const{textColor:i,textSize:d,dHl:p,hlColor:C,fontBold:a}=B,t=[n("BODYTEXT",d)];if(!p){const r=[n("TEXTCOLOR",i),n("HVTEXTCOLOR",C),n("FCTEXTCOLOR",C)];t.push(r.join(" "))}if(p){const r=n("BEFOREBG",C);t.push("before:inset-y-0 before:left-0 before:transition-[width] before:duration-300 before:ease-linear before:w-0 hover:before:w-full focus:before:w-full "+r);const m=[n("TEXTCOLOR",C),n("HVTEXTCOLOR",i),n("FCTEXTCOLOR",i)];t.push(m.join(" "))}return a&&t.push("font-bold"),t.join(" ")});return(i,d)=>(e.openBlock(),e.createElementBlock("a",{class:e.normalizeClass([[g.value],"px-xs py-2xs relative text-center block w-full before:absolute transition-colors duration-300 ease-linear"]),href:i.menuItem.url,target:i.menuItem.target?i.menuItem.target:"_self",onClick:d[0]||(d[0]=p=>f(p,i.menuItem))},[e.createElementVNode("span",re,e.toDisplayString(i.menuItem.title),1)],10,ie))}}),ae={class:"p-md text-center"},se=["href","target"],ce=["src","alt"],de=["href","target"],me=["innerHTML"],he={class:"flex flex-col"},fe={key:0},ke={class:"flex flex-col justify-between h-full"},pe={class:"p-md text-center"},ue=["href","target"],ge=["src","alt"],Ce=["href","target"],Be=["innerHTML"],be={class:"flex flex-col"},Te={key:0},ye=e.defineComponent({__name:"MclHeaderB",props:{logo:{},logoAlt:{default:""},title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},titleBlockAsLink:{type:Boolean,default:!1},titleBlockLinkTarget:{default:"_self"},titleBlockLink:{},menuItems:{},menuItemAsLink:{type:Boolean,default:!1},menuTextSize:{default:"md"},menuTextColor:{default:"dark-3"},menuTextBold:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},bgColor:{default:"light-1"},drawerBtnColor:{default:"dark-1"},drawerBtnBorder:{type:Boolean,default:!0},headerWidth:{default:160}},emits:["toggle-drawer","title-click","menu-click","collapse-click"],setup(b,{expose:T,emit:B}){const k=b,f=e.useSlots(),g=B,i=e.ref(),d=e.ref(),p=(l,s)=>{g("toggle-drawer",l,s)},C=()=>{var l;(l=i.value)==null||l.headerClose()},a=()=>{for(let l=0;l<d.value.length;l++)d.value[l].closeCollapse()},t=l=>{const{titleBlockAsLink:s,titleBlockLink:c,titleBlockLinkTarget:h}=k;s||l.preventDefault(),g("title-click",l,c,h),C(),a()},r=(l,s)=>{const{menuItemAsLink:c}=k;c||l.preventDefault(),g("menu-click",l,s),C(),a()},o=(l,s,c)=>{g("collapse-click",l,s,c)},m=e.computed(()=>{const{titleSize:l,titleColor:s}=k;return[n("H3",l),n("TEXTCOLOR",s)].join(" ")}),u=l=>{const s=l;return typeof s.children>"u"?!1:s.children.length>0};return T({headerClose:C}),(l,s)=>(e.openBlock(),e.createBlock(e.unref(n.HeaderVertical),{"bg-color":l.bgColor,"drawer-btn-color":l.drawerBtnColor,"drawer-btn-border":l.drawerBtnBorder,"header-width":l.headerWidth,onToggleDrawer:p,ref_key:"componentRef",ref:i},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),content:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("div",ae,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:t},[e.createElementVNode("img",{src:l.logo,alt:l.logoAlt,class:"h-full inline-block max-h-xl"},null,8,ce)],8,se)]),e.createElementVNode("div",null,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:t},[e.createElementVNode("h3",{class:e.normalizeClass([m.value,"text-center mb-md"]),innerHTML:l.title},null,10,me)],8,de)]),e.createElementVNode("ul",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.menuItems,(c,h)=>(e.openBlock(),e.createElementBlock("li",{key:`menu-${h}`},[u(c)?(e.openBlock(),e.createBlock(V,{key:1,ref_for:!0,ref_key:"collapseRef",ref:d,"nav-id":c.title,"nav-location":"desktop","nav-accordion-group":l.title,"menu-item":c,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onChildClick:r,onLabelClick:o},null,8,["nav-id","nav-accordion-group","menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"])):(e.openBlock(),e.createBlock(I,{key:0,"menu-item":c,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onMenuClick:r},null,8,["menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"]))]))),128))])])]),"content-bottom":e.withCtx(()=>[f["content-bottom"]?(e.openBlock(),e.createElementBlock("div",fe,[e.renderSlot(l.$slots,"content-bottom")])):e.createCommentVNode("",!0)]),"mobile-content":e.withCtx(({headerClose:c})=>[e.createElementVNode("div",ke,[e.createElementVNode("div",null,[e.createElementVNode("div",pe,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:t},[e.createElementVNode("img",{src:l.logo,alt:l.logoAlt,class:"h-full inline-block max-h-xl"},null,8,ge)],8,ue)]),e.createElementVNode("div",null,[e.createElementVNode("a",{href:l.titleBlockLink,target:l.titleBlockLinkTarget,onClick:t},[e.createElementVNode("h3",{class:e.normalizeClass([m.value,"text-center mb-md"]),innerHTML:l.title},null,10,Be)],8,Ce)]),e.createElementVNode("ul",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.menuItems,(h,E)=>(e.openBlock(),e.createElementBlock("li",{key:`menu-${E}`},[u(h)?(e.openBlock(),e.createBlock(V,{key:1,"nav-id":h.title,"nav-location":"mobile","nav-accordion-group":l.title,"menu-item":h,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onChildClick:r,onLabelClick:o},null,8,["nav-id","nav-accordion-group","menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"])):(e.openBlock(),e.createBlock(I,{key:0,"menu-item":h,"as-link":l.menuItemAsLink,"text-color":l.menuTextColor,"text-size":l.menuTextSize,"font-bold":l.menuTextBold,"d-hl":l.displayHighlight,"hl-color":l.highlightColor,onMenuClick:r},null,8,["menu-item","as-link","text-color","text-size","font-bold","d-hl","hl-color"]))]))),128))])]),f["mobile-bottom"]?(e.openBlock(),e.createElementBlock("div",Te,[e.renderSlot(l.$slots,"mobile-bottom",{headerClose:c})])):e.createCommentVNode("",!0)])]),_:3},8,["bg-color","drawer-btn-color","drawer-btn-border","header-width"]))}});L.MclHeaderA=le,L.MclHeaderB=ye,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/mcl-header",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "header components based on manguito theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@bobbykim/manguito-theme": "0.
|
|
37
|
-
"vue": "^3.
|
|
36
|
+
"@bobbykim/manguito-theme": "0.23.0",
|
|
37
|
+
"vue": "^3.5.13"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@vitejs/plugin-vue": "^
|
|
41
|
-
"sass": "^1.
|
|
42
|
-
"typescript": "^5.
|
|
43
|
-
"vite": "^
|
|
44
|
-
"vite-plugin-css-injected-by-js": "^3.5.
|
|
45
|
-
"vite-plugin-dts": "^3.
|
|
46
|
-
"vue-tsc": "^1.
|
|
40
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
41
|
+
"sass": "^1.82.0",
|
|
42
|
+
"typescript": "^5.7.2",
|
|
43
|
+
"vite": "^6.0.3",
|
|
44
|
+
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
45
|
+
"vite-plugin-dts": "^4.3.0",
|
|
46
|
+
"vue-tsc": "^2.1.10"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "0c86a1a70a33446112dafbaf5fce5fdcb5fdf755"
|
|
49
49
|
}
|