@kong-ui-public/app-layout 0.19.6 → 0.19.7-pr.524.170a3ca.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.
@@ -1826,4 +1826,3 @@ export {
1826
1826
  Mr as SidebarToggle,
1827
1827
  di as default
1828
1828
  };
1829
- //# sourceMappingURL=app-layout.es.js.map
@@ -9,4 +9,3 @@
9
9
  * (c) 2023 Eduardo San Martin Morote
10
10
  * @license MIT
11
11
  */function Or(r){return r}const wn={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object},kn=e.defineComponent({props:Object.assign({active:{type:Boolean,default:!0}},wn),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(r,{slots:n,emit:a}){let o;const l=e.ref(null),f=e.computed(()=>{const b=l.value;return b&&(b instanceof HTMLElement?b:b.$el)});function c(){return o||(o=_n(f.value,{escapeDeactivates:r.escapeDeactivates,allowOutsideClick:r.allowOutsideClick,returnFocusOnDeactivate:r.returnFocusOnDeactivate,clickOutsideDeactivates:r.clickOutsideDeactivates,onActivate:()=>{a("update:active",!0),a("activate")},onDeactivate:()=>{a("update:active",!1),a("deactivate")},onPostActivate:()=>a("postActivate"),onPostDeactivate:()=>a("postDeactivate"),initialFocus:r.initialFocus,fallbackFocus:r.fallbackFocus,tabbableOptions:r.tabbableOptions,delayInitialFocus:r.delayInitialFocus}))}return e.onMounted(()=>{e.watch(()=>r.active,b=>{b&&f.value?c().activate():o&&(o.deactivate(),(!f.value||f.value.nodeType===Node.COMMENT_NODE)&&(o=null))},{immediate:!0,flush:"post"})}),e.onUnmounted(()=>{o&&o.deactivate(),o=null}),{activate(){c().activate()},deactivate(){o&&o.deactivate()},renderImpl(){if(!n.default)return null;const b=n.default().filter(v=>v.type!==e.Comment);return!b||!b.length||b.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),b):e.cloneVNode(b[0],{ref:l})}}}});function Qe(){return{debounce:(n,a)=>{let o;return(...l)=>{clearTimeout(o),o=window==null?void 0:window.setTimeout(()=>{n(...l)},a)}}}}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var he={exports:{}};he.exports,function(r,n){var a=200,o="__lodash_hash_undefined__",l=9007199254740991,f="[object Arguments]",c="[object Array]",b="[object Boolean]",g="[object Date]",v="[object Error]",E="[object Function]",T="[object GeneratorFunction]",I="[object Map]",w="[object Number]",S="[object Object]",F="[object Promise]",M="[object RegExp]",$="[object Set]",K="[object String]",P="[object Symbol]",y="[object WeakMap]",x="[object ArrayBuffer]",j="[object DataView]",z="[object Float32Array]",V="[object Float64Array]",k="[object Int8Array]",d="[object Int16Array]",u="[object Int32Array]",p="[object Uint8Array]",h="[object Uint8ClampedArray]",_="[object Uint16Array]",N="[object Uint32Array]",B=/[\\^$.*+?()[\]{}|]/g,A=/\w*$/,Ee=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,C={};C[f]=C[c]=C[x]=C[j]=C[b]=C[g]=C[z]=C[V]=C[k]=C[d]=C[u]=C[I]=C[w]=C[S]=C[M]=C[$]=C[K]=C[P]=C[p]=C[h]=C[_]=C[N]=!0,C[v]=C[E]=C[y]=!1;var Ne=typeof me=="object"&&me&&me.Object===Object&&me,ie=typeof self=="object"&&self&&self.Object===Object&&self,Z=Ne||ie||Function("return this")(),rt=n&&!n.nodeType&&n,ot=rt&&!0&&r&&!r.nodeType&&r,sa=ot&&ot.exports===rt;function la(t,i){return t.set(i[0],i[1]),t}function da(t,i){return t.add(i),t}function ua(t,i){for(var s=-1,m=t?t.length:0;++s<m&&i(t[s],s,t)!==!1;);return t}function fa(t,i){for(var s=-1,m=i.length,O=t.length;++s<m;)t[O+s]=i[s];return t}function it(t,i,s,m){var O=-1,D=t?t.length:0;for(m&&D&&(s=t[++O]);++O<D;)s=i(s,t[O],O,t);return s}function pa(t,i){for(var s=-1,m=Array(t);++s<t;)m[s]=i(s);return m}function ba(t,i){return t==null?void 0:t[i]}function ct(t){var i=!1;if(t!=null&&typeof t.toString!="function")try{i=!!(t+"")}catch{}return i}function st(t){var i=-1,s=Array(t.size);return t.forEach(function(m,O){s[++i]=[O,m]}),s}function Ie(t,i){return function(s){return t(i(s))}}function lt(t){var i=-1,s=Array(t.size);return t.forEach(function(m){s[++i]=m}),s}var ma=Array.prototype,ha=Function.prototype,ge=Object.prototype,Be=Z["__core-js_shared__"],dt=function(){var t=/[^.]+$/.exec(Be&&Be.keys&&Be.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ut=ha.toString,G=ge.hasOwnProperty,ve=ge.toString,ga=RegExp("^"+ut.call(G).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=sa?Z.Buffer:void 0,pt=Z.Symbol,bt=Z.Uint8Array,va=Ie(Object.getPrototypeOf,Object),ya=Object.create,_a=ge.propertyIsEnumerable,wa=ma.splice,mt=Object.getOwnPropertySymbols,ka=ft?ft.isBuffer:void 0,Sa=Ie(Object.keys,Object),Oe=ne(Z,"DataView"),ce=ne(Z,"Map"),xe=ne(Z,"Promise"),Ae=ne(Z,"Set"),Fe=ne(Z,"WeakMap"),se=ne(Object,"create"),Ca=Q(Oe),Ta=Q(ce),Ea=Q(xe),Na=Q(Ae),Ia=Q(Fe),ht=pt?pt.prototype:void 0,gt=ht?ht.valueOf:void 0;function X(t){var i=-1,s=t?t.length:0;for(this.clear();++i<s;){var m=t[i];this.set(m[0],m[1])}}function Ba(){this.__data__=se?se(null):{}}function Oa(t){return this.has(t)&&delete this.__data__[t]}function xa(t){var i=this.__data__;if(se){var s=i[t];return s===o?void 0:s}return G.call(i,t)?i[t]:void 0}function Aa(t){var i=this.__data__;return se?i[t]!==void 0:G.call(i,t)}function Fa(t,i){var s=this.__data__;return s[t]=se&&i===void 0?o:i,this}X.prototype.clear=Ba,X.prototype.delete=Oa,X.prototype.get=xa,X.prototype.has=Aa,X.prototype.set=Fa;function W(t){var i=-1,s=t?t.length:0;for(this.clear();++i<s;){var m=t[i];this.set(m[0],m[1])}}function $a(){this.__data__=[]}function Da(t){var i=this.__data__,s=ye(i,t);if(s<0)return!1;var m=i.length-1;return s==m?i.pop():wa.call(i,s,1),!0}function Va(t){var i=this.__data__,s=ye(i,t);return s<0?void 0:i[s][1]}function La(t){return ye(this.__data__,t)>-1}function Ra(t,i){var s=this.__data__,m=ye(s,t);return m<0?s.push([t,i]):s[m][1]=i,this}W.prototype.clear=$a,W.prototype.delete=Da,W.prototype.get=Va,W.prototype.has=La,W.prototype.set=Ra;function ee(t){var i=-1,s=t?t.length:0;for(this.clear();++i<s;){var m=t[i];this.set(m[0],m[1])}}function Ma(){this.__data__={hash:new X,map:new(ce||W),string:new X}}function Pa(t){return _e(this,t).delete(t)}function Za(t){return _e(this,t).get(t)}function ja(t){return _e(this,t).has(t)}function Ha(t,i){return _e(this,t).set(t,i),this}ee.prototype.clear=Ma,ee.prototype.delete=Pa,ee.prototype.get=Za,ee.prototype.has=ja,ee.prototype.set=Ha;function te(t){this.__data__=new W(t)}function Ka(){this.__data__=new W}function za(t){return this.__data__.delete(t)}function Ua(t){return this.__data__.get(t)}function Wa(t){return this.__data__.has(t)}function Ga(t,i){var s=this.__data__;if(s instanceof W){var m=s.__data__;if(!ce||m.length<a-1)return m.push([t,i]),this;s=this.__data__=new ee(m)}return s.set(t,i),this}te.prototype.clear=Ka,te.prototype.delete=za,te.prototype.get=Ua,te.prototype.has=Wa,te.prototype.set=Ga;function qa(t,i){var s=Ve(t)||yr(t)?pa(t.length,String):[],m=s.length,O=!!m;for(var D in t)(i||G.call(t,D))&&!(O&&(D=="length"||mr(D,m)))&&s.push(D);return s}function vt(t,i,s){var m=t[i];(!(G.call(t,i)&&kt(m,s))||s===void 0&&!(i in t))&&(t[i]=s)}function ye(t,i){for(var s=t.length;s--;)if(kt(t[s][0],i))return s;return-1}function Ya(t,i){return t&&yt(i,Le(i),t)}function $e(t,i,s,m,O,D,H){var L;if(m&&(L=D?m(t,O,D,H):m(t)),L!==void 0)return L;if(!we(t))return t;var Tt=Ve(t);if(Tt){if(L=fr(t),!i)return lr(t,L)}else{var ae=J(t),Et=ae==E||ae==T;if(wr(t))return nr(t,i);if(ae==S||ae==f||Et&&!D){if(ct(t))return D?t:{};if(L=pr(Et?{}:t),!i)return dr(t,Ya(L,t))}else{if(!C[ae])return D?t:{};L=br(t,ae,$e,i)}}H||(H=new te);var Nt=H.get(t);if(Nt)return Nt;if(H.set(t,L),!Tt)var It=s?ur(t):Le(t);return ua(It||t,function(Re,ke){It&&(ke=Re,Re=t[ke]),vt(L,ke,$e(Re,i,s,m,ke,t,H))}),L}function Xa(t){return we(t)?ya(t):{}}function Ja(t,i,s){var m=i(t);return Ve(t)?m:fa(m,s(t))}function Qa(t){return ve.call(t)}function er(t){if(!we(t)||gr(t))return!1;var i=Ct(t)||ct(t)?ga:Ee;return i.test(Q(t))}function tr(t){if(!wt(t))return Sa(t);var i=[];for(var s in Object(t))G.call(t,s)&&s!="constructor"&&i.push(s);return i}function nr(t,i){if(i)return t.slice();var s=new t.constructor(t.length);return t.copy(s),s}function De(t){var i=new t.constructor(t.byteLength);return new bt(i).set(new bt(t)),i}function ar(t,i){var s=i?De(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}function rr(t,i,s){var m=i?s(st(t),!0):st(t);return it(m,la,new t.constructor)}function or(t){var i=new t.constructor(t.source,A.exec(t));return i.lastIndex=t.lastIndex,i}function ir(t,i,s){var m=i?s(lt(t),!0):lt(t);return it(m,da,new t.constructor)}function cr(t){return gt?Object(gt.call(t)):{}}function sr(t,i){var s=i?De(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}function lr(t,i){var s=-1,m=t.length;for(i||(i=Array(m));++s<m;)i[s]=t[s];return i}function yt(t,i,s,m){s||(s={});for(var O=-1,D=i.length;++O<D;){var H=i[O],L=m?m(s[H],t[H],H,s,t):void 0;vt(s,H,L===void 0?t[H]:L)}return s}function dr(t,i){return yt(t,_t(t),i)}function ur(t){return Ja(t,Le,_t)}function _e(t,i){var s=t.__data__;return hr(i)?s[typeof i=="string"?"string":"hash"]:s.map}function ne(t,i){var s=ba(t,i);return er(s)?s:void 0}var _t=mt?Ie(mt,Object):Cr,J=Qa;(Oe&&J(new Oe(new ArrayBuffer(1)))!=j||ce&&J(new ce)!=I||xe&&J(xe.resolve())!=F||Ae&&J(new Ae)!=$||Fe&&J(new Fe)!=y)&&(J=function(t){var i=ve.call(t),s=i==S?t.constructor:void 0,m=s?Q(s):void 0;if(m)switch(m){case Ca:return j;case Ta:return I;case Ea:return F;case Na:return $;case Ia:return y}return i});function fr(t){var i=t.length,s=t.constructor(i);return i&&typeof t[0]=="string"&&G.call(t,"index")&&(s.index=t.index,s.input=t.input),s}function pr(t){return typeof t.constructor=="function"&&!wt(t)?Xa(va(t)):{}}function br(t,i,s,m){var O=t.constructor;switch(i){case x:return De(t);case b:case g:return new O(+t);case j:return ar(t,m);case z:case V:case k:case d:case u:case p:case h:case _:case N:return sr(t,m);case I:return rr(t,m,s);case w:case K:return new O(t);case M:return or(t);case $:return ir(t,m,s);case P:return cr(t)}}function mr(t,i){return i=i??l,!!i&&(typeof t=="number"||Y.test(t))&&t>-1&&t%1==0&&t<i}function hr(t){var i=typeof t;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?t!=="__proto__":t===null}function gr(t){return!!dt&&dt in t}function wt(t){var i=t&&t.constructor,s=typeof i=="function"&&i.prototype||ge;return t===s}function Q(t){if(t!=null){try{return ut.call(t)}catch{}try{return t+""}catch{}}return""}function vr(t){return $e(t,!0,!0)}function kt(t,i){return t===i||t!==t&&i!==i}function yr(t){return _r(t)&&G.call(t,"callee")&&(!_a.call(t,"callee")||ve.call(t)==f)}var Ve=Array.isArray;function St(t){return t!=null&&kr(t.length)&&!Ct(t)}function _r(t){return Sr(t)&&St(t)}var wr=ka||Tr;function Ct(t){var i=we(t)?ve.call(t):"";return i==E||i==T}function kr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}function we(t){var i=typeof t;return!!t&&(i=="object"||i=="function")}function Sr(t){return!!t&&typeof t=="object"}function Le(t){return St(t)?qa(t):tr(t)}function Cr(){return[]}function Tr(){return!1}r.exports=vr}(he,he.exports);var Cn=he.exports;const Tn=Sn(Cn),En={key:0,class:"sidebar-header"},Nn={class:"sidebar-content-container"},In={key:0,class:"sidebar-top"},Bn={"aria-label":"Main menu"},On={key:0,class:"level-primary top-items"},xn={key:1,class:"sidebar-level-divider",role:"separator"},An={key:2,class:"level-primary bottom-items"},Fn={class:"sidebar-footer"},$n=e.defineComponent({__name:"AppSidebar",props:{topItems:{type:Array,default:()=>[]},bottomItems:{type:Array,default:()=>[]},headerHeight:{type:Number,default:60},topOffset:{type:Number,default:0},zIndex:{type:Number,default:2},open:{type:Boolean,default:!1},mobileEnabled:{type:Boolean,default:!1},mobileTopOffset:{type:Number,default:0},mobileHeaderVisible:{type:Boolean,default:!1},mobileCloseDelay:{type:Number,default:350},mobileOverlay:{type:Boolean,default:!0},mobileOverlayZIndex:{type:Number,default:null},mobileOverlayCloseOnClick:{type:Boolean,default:!0}},emits:["click","toggle"],setup(r,{emit:n}){const a=r;e.useCssVars(u=>({"160797d0":e.unref(c).mobileHeight,"721527f8":e.unref(c).mobileTop,"054b3490":r.zIndex,"6b0e6816":e.unref(c).height,"31cc2e74":e.unref(c).top,"16bd691a":e.unref(g).marginTop,"08886e32":e.unref(b).display,"1d2550ee":e.unref(b).minHeight,ed4e7e56:e.unref(v).top,"377644f8":e.unref(v).zIndex}));const o=e.useSlots(),l=e.computed(()=>!!o.header),f=e.computed(()=>!!o.top),c=e.computed(()=>({mobileTop:a.mobileTopOffset&&a.mobileEnabled?`${a.mobileTopOffset}px`:a.topOffset?`${a.topOffset}px`:"0",top:a.topOffset?`${a.topOffset}px`:"0",mobileHeight:a.mobileTopOffset&&a.mobileEnabled?`calc(100% - ${a.mobileTopOffset}px)`:"100%",height:a.topOffset?`calc(100% - ${a.topOffset}px)`:"100%"})),b=e.computed(()=>({display:!a.mobileHeaderVisible&&a.mobileEnabled?"none":"flex",minHeight:`${a.headerHeight}px`})),g=e.computed(()=>({marginTop:l.value?`${a.headerHeight}px`:"0"})),v=e.computed(()=>({top:a.mobileTopOffset&&a.mobileEnabled?`${a.mobileTopOffset}px`:"0",zIndex:a.mobileOverlayZIndex!==null?a.mobileOverlayZIndex:a.zIndex>1?a.zIndex-1:1})),E=u=>Tn(u).map(h=>{var _,N,B;if(h){(!h.key||!((_=h.key)!=null&&_.trim()))&&(h.key=String(h.name||"").trim().toLowerCase().replace(/[^[a-z]/gi,"-")),(!h.testId||!((N=h.testId)!=null&&N.trim()))&&(h.testId=String(h.name||"").trim().toLowerCase().replace(/[^[a-z]/gi,"-"));for(const A of h.items||[])A.parentKey=h.key,(!A.testId||!((B=A.testId)!=null&&B.trim()))&&(A.testId=String(A.name||"").trim().toLowerCase().replace(/[^[a-z]/gi,"-"))}return h}),T=e.computed(()=>a.topItems.length?E(a.topItems):[]),I=e.computed(()=>a.bottomItems.length?E(a.bottomItems):[]),w=e.ref(a.open),S=u=>{var p,h;w.value!==u&&(w.value=u,n("toggle",u)),u?(p=document==null?void 0:document.body)==null||p.classList.add("kong-ui-app-sidebar-open"):(h=document==null?void 0:document.body)==null||h.classList.remove("kong-ui-app-sidebar-open"),M.value=!1},F=()=>{a.mobileOverlayCloseOnClick&&S(!1)},M=e.ref(!1),$=u=>{M.value=!0,n("click",u),setTimeout(()=>{S(!1)},a.mobileCloseDelay)};e.watch(()=>a.open,u=>{S(u)});const{debounce:K}=Qe(),P=K(()=>{w.value&&y.value!==(window==null?void 0:window.innerWidth)&&(y.value=window==null?void 0:window.innerWidth,S(!1))},200),y=e.ref(),x=e.ref(!1),j=e.ref(),z=()=>{x.value||(x.value=!0,clearTimeout(j.value),j.value=setTimeout(()=>x.value=!1,1300))},V=e.ref(null),k=e.computed(()=>w.value&&a.mobileEnabled),d=async u=>{var p,h;u?(await e.nextTick(),await new Promise(_=>setTimeout(_,300)),(p=V.value)==null||p.activate()):(h=V.value)==null||h.deactivate()};return e.watch(k,async u=>{u?await d(!0):await d(!1)},{immediate:!0}),e.onMounted(()=>{y.value=window==null?void 0:window.innerWidth,window.addEventListener("resize",P),window.addEventListener("resize",z)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",P),window.removeEventListener("resize",z)}),(u,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[w.value&&r.mobileOverlay&&r.mobileEnabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"kong-ui-app-sidebar-overlay",onClick:F})):e.createCommentVNode("",!0),e.createVNode(e.unref(kn),{ref_key:"focusTrap",ref:V,active:!1,"allow-outside-click":"","fallback-focus":".kong-ui-app-sidebar"},{default:e.withCtx(()=>[e.createElementVNode("aside",{class:e.normalizeClass(["kong-ui-app-sidebar",{"sidebar-open":w.value,"no-sidebar-header":!e.unref(l),"mobile-header-hidden":r.mobileEnabled&&(!e.unref(l)||!r.mobileHeaderVisible),"mobile-disabled":!r.mobileEnabled,"disable-transitions":x.value}]),tabindex:"-1"},[e.unref(l)?(e.openBlock(),e.createElementBlock("div",En,[e.renderSlot(u.$slots,"header",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Nn,[e.unref(f)?(e.openBlock(),e.createElementBlock("div",In,[e.renderSlot(u.$slots,"top",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("nav",Bn,[e.unref(T).length?(e.openBlock(),e.createElementBlock("ul",On,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(T),h=>(e.openBlock(),e.createBlock(Pe,{key:h.name,item:h,onClick:$},null,8,["item"]))),128))])):e.createCommentVNode("",!0),e.unref(T).length&&e.unref(I).length?(e.openBlock(),e.createElementBlock("div",xn)):e.createCommentVNode("",!0),e.unref(I).length?(e.openBlock(),e.createElementBlock("ul",An,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(I),h=>(e.openBlock(),e.createBlock(Pe,{key:h.name,item:h,onClick:$},null,8,["item"]))),128))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Fn,[e.renderSlot(u.$slots,"footer",{},void 0,!0)])],2)]),_:3},512)],64))}}),xr="",Ar="",et=U($n,[["__scopeId","data-v-6daf9f02"]]),Te=r=>(e.pushScopeId("data-v-33b3f7c3"),r=r(),e.popScopeId(),r),Dn=["aria-label","onClick"],Vn=[Te(()=>e.createElementVNode("span",{class:"line"},null,-1)),Te(()=>e.createElementVNode("span",{class:"line"},null,-1)),Te(()=>e.createElementVNode("span",{class:"line"},null,-1))],Ln=e.defineComponent({__name:"SidebarToggle",props:{active:{type:Boolean,default:!1}},emits:["toggle"],setup(r,{emit:n}){const a=r,o=e.ref(a.active||!1),l=()=>{o.value=!o.value,n("toggle",o.value)};return e.watch(()=>a.active,f=>{o.value=f}),(f,c)=>(e.openBlock(),e.createElementBlock("a",{"aria-haspopup":"true","aria-label":o.value?"Close Main Menu":"Open Main Menu",class:e.normalizeClass(["sidebar-menu-toggle",{active:o.value}]),href:"#",role:"button",onClick:e.withModifiers(l,["prevent"])},Vn,10,Dn))}}),Vr="",tt=U(Ln,[["__scopeId","data-v-33b3f7c3"]]),Rn=r=>(e.pushScopeId("data-v-37316186"),r=r(),e.popScopeId(),r),Mn={id:"kong-ui-app-layout-notification"},Pn={class:"mobile-logo"},Zn={key:0,class:"navbar-logo"},jn={class:"kong-ui-app-layout-main","data-testid":"kong-ui-app-layout-main"},Hn={class:"kong-ui-app-layout-content"},Kn={class:"kong-ui-app-layout-content-inner"},zn=Rn(()=>e.createElementVNode("div",{id:"kong-ui-app-layout-teleport-default-slot"},null,-1)),Un=e.defineComponent({__name:"AppLayout",props:{hideDefaultSlot:{type:Boolean,default:!1},navbarHidden:{type:Boolean,default:!1},sidebarHidden:{type:Boolean,default:!1},sidebarOpen:{type:Boolean,default:!1},sidebarTopItems:{type:Array,default:()=>[]},sidebarBottomItems:{type:Array,default:()=>[]}},emits:["sidebar-click"],setup(r,{emit:n}){const a=r;e.useCssVars(y=>({"06ca369a":e.unref(F),"7d4a09e6":e.unref(M)}));const o=e.useSlots(),l=e.reactive({navbarLeft:e.computed(()=>!!o["navbar-left"]),navbarCenter:e.computed(()=>!!o["navbar-center"]),navbarRight:e.computed(()=>!!o["navbar-right"]),navbarLogo:e.computed(()=>!!o["navbar-logo"]),navbarMobileLogo:e.computed(()=>!!o["navbar-mobile-logo"]),sidebarHeader:e.computed(()=>!!o["sidebar-header"]),sidebarTop:e.computed(()=>!!o["sidebar-top"]),sidebarFooter:e.computed(()=>!!o["sidebar-footer"])}),f=e.computed(()=>a.hideDefaultSlot),c=e.reactive({hidden:e.computed(()=>a.navbarHidden)}),b=e.reactive({topItems:e.computed(()=>a.sidebarTopItems),bottomItems:e.computed(()=>a.sidebarBottomItems),open:e.computed(()=>a.sidebarOpen),hidden:e.computed(()=>a.sidebarHidden)}),g=y=>{n("sidebar-click",y)},v=e.ref(!1),E=y=>{v.value=y};e.watchEffect(()=>{v.value=e.toRef(b,"open").value||!1});const T=e.ref(0),I=e.ref(60),w=e.ref(0),S=e.computed(()=>c.hidden?w.value:I.value+w.value),F=e.computed(()=>`${S.value}px`),M=e.computed(()=>b.hidden||c.hidden?"0":"16px"),{debounce:$}=Qe(),K=$((y=!1)=>{if(y||T.value!==(window==null?void 0:window.innerWidth)){T.value=window==null?void 0:window.innerWidth;const x=document==null?void 0:document.querySelector(".kong-ui-app-layout #kong-ui-app-layout-notification");x&&(w.value=x.offsetHeight)}},200),P=e.ref();return e.onMounted(()=>{var x,j;(x=document==null?void 0:document.body)==null||x.classList.add("kong-ui-app-layout-body"),(j=document==null?void 0:document.documentElement)==null||j.classList.add("kong-ui-app-layout-html"),T.value=window==null?void 0:window.innerWidth,K(!0);const y=document==null?void 0:document.querySelector(".kong-ui-app-layout #kong-ui-app-layout-notification");y&&(P.value=new ResizeObserver(z=>{for(const V of z){const k=V.contentRect.height;w.value!==k&&(w.value=k)}}),P.value.observe(y)),window.addEventListener("resize",K)}),e.onBeforeUnmount(()=>{P.value&&P.value.disconnect(),window.removeEventListener("resize",K)}),(y,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["kong-ui-app-layout",[{"navbar-hidden":c.hidden},{"sidebar-hidden":b.hidden}]])},[e.createElementVNode("div",Mn,[e.renderSlot(y.$slots,"notification",{},void 0,!0)]),c.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Me,{key:String(b.hidden),"left-offset":b.hidden?0:void 0,"top-offset":w.value},e.createSlots({"mobile-sidebar-toggle":e.withCtx(()=>[b.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(tt,{key:0,active:v.value,onToggle:E},null,8,["active"]))]),_:2},[l.navbarMobileLogo?{name:"mobile-logo",fn:e.withCtx(()=>[e.createElementVNode("div",Pn,[e.renderSlot(y.$slots,"navbar-mobile-logo",{},void 0,!0)])]),key:"0"}:void 0,l.navbarLogo?{name:"logo",fn:e.withCtx(()=>[b.hidden?(e.openBlock(),e.createElementBlock("div",Zn,[e.renderSlot(y.$slots,"navbar-logo",{},void 0,!0)])):e.createCommentVNode("",!0)]),key:"1"}:void 0,l.navbarLeft?{name:"left",fn:e.withCtx(()=>[e.renderSlot(y.$slots,"navbar-left",{},void 0,!0)]),key:"2"}:void 0,l.navbarCenter?{name:"center",fn:e.withCtx(()=>[e.renderSlot(y.$slots,"navbar-center",{},void 0,!0)]),key:"3"}:void 0,l.navbarRight?{name:"right",fn:e.withCtx(()=>[e.renderSlot(y.$slots,"navbar-right",{},void 0,!0)]),key:"4"}:void 0]),1032,["left-offset","top-offset"])),b.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(et,{key:1,"bottom-items":b.bottomItems,"header-height":I.value,"mobile-enabled":"","mobile-header-visible":!1,"mobile-top-offset":e.unref(S),open:v.value,"top-items":b.topItems,"top-offset":w.value,onClick:g,onToggle:E},e.createSlots({_:2},[l.sidebarHeader?{name:"header",fn:e.withCtx(()=>[e.renderSlot(y.$slots,"sidebar-header",{},void 0,!0)]),key:"0"}:void 0,l.sidebarTop?{name:"top",fn:e.withCtx(()=>[e.renderSlot(y.$slots,"sidebar-top",{},void 0,!0)]),key:"1"}:void 0,l.sidebarFooter?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(y.$slots,"sidebar-footer",{},void 0,!0)]),key:"2"}:void 0]),1032,["bottom-items","header-height","mobile-top-offset","open","top-items","top-offset"])),e.createElementVNode("main",jn,[e.createElementVNode("div",Hn,[e.createElementVNode("div",Kn,[zn,e.renderSlot(y.$slots,"app-error",{},void 0,!0),e.unref(f)?e.createCommentVNode("",!0):e.renderSlot(y.$slots,"default",{key:0},void 0,!0)])])])],2))}}),Lr="",Rr="",nt=U(Un,[["__scopeId","data-v-37316186"]]),Wn=e.defineComponent({__name:"AccountDropdown",props:{options:{type:Array,required:!0},width:{type:String,default:"240"},userInitials:{type:String,required:!0,default:" "}},setup(r){return(n,a)=>{const o=e.resolveComponent("KDropdownItem"),l=e.resolveComponent("KDropdownMenu");return e.openBlock(),e.createBlock(l,{class:"account-dropdown","kpop-attributes":{placement:"bottomStart"},label:r.userInitials,size:"small",width:r.width},{items:e.withCtx(({handleSelection:f})=>[e.renderSlot(n.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options,c=>(e.openBlock(),e.createBlock(o,{key:c.value,class:e.normalizeClass({"has-divider":c.hasDivider}),"data-testid":"select-"+c.value,"has-divider":c.hasDivider,onClick:b=>f(c)},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{option:c},()=>[e.createTextVNode(e.toDisplayString(c.label),1)],!0)]),_:2},1032,["class","data-testid","has-divider","onClick"]))),128))],!0)]),_:3},8,["label","width"])}}}),Mr="",Gn=U(Wn,[["__scopeId","data-v-6e34d3da"]]),qn={},Yn={fill:"none",height:"130",width:"130",xmlns:"http://www.w3.org/2000/svg"},Xn=[e.createStaticVNode('<path clip-rule="evenodd" d="M19.111 120.198c-.226 0-.409-.164-.409-.368v-4.812c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.812c0 .204-.183.368-.409.368Zm0-9.625c-.226 0-.409-.165-.409-.368v-4.813c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.226 0-.409-.165-.409-.368v-4.813c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.226 0-.409-.165-.409-.368v-4.812c0-.204.183-.368.409-.368.226 0 .409.164.409.368v4.812c0 .204-.183.368-.409.368Zm0-9.625c-.226 0-.409-.165-.409-.368v-4.813c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.226 0-.409-.164-.409-.367V66.89c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.226 0-.409-.165-.409-.368v-4.813c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.226 0-.409-.165-.409-.368V47.64c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.226 0-.409-.164-.409-.368v-4.812c0-.204.183-.368.409-.368.226 0 .409.164.409.368v4.812c0 .204-.183.368-.409.368Zm0-9.625c-.226 0-.409-.165-.409-.368v-4.813c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.226 0-.409-.165-.409-.369v-4.812c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.226 0-.409-.165-.409-.368V9.138c0-.203.183-.368.409-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368ZM110.889 120.198c-.225 0-.408-.164-.408-.368v-4.812c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.812c0 .204-.183.368-.409.368Zm0-9.625c-.225 0-.408-.165-.408-.368v-4.813c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.225 0-.408-.165-.408-.368v-4.813c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.225 0-.408-.165-.408-.368v-4.812c0-.204.183-.368.408-.368.226 0 .409.164.409.368v4.812c0 .204-.183.368-.409.368Zm0-9.625c-.225 0-.408-.165-.408-.368v-4.813c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.225 0-.408-.164-.408-.367V66.89c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.225 0-.408-.165-.408-.368v-4.813c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.225 0-.408-.165-.408-.368V47.64c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.225 0-.408-.164-.408-.368v-4.812c0-.204.183-.368.408-.368.226 0 .409.164.409.368v4.812c0 .204-.183.368-.409.368Zm0-9.625c-.225 0-.408-.165-.408-.368v-4.813c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.625c-.225 0-.408-.165-.408-.369v-4.812c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Zm0-9.626c-.225 0-.408-.165-.408-.368V9.138c0-.203.183-.368.408-.368.226 0 .409.165.409.368v4.813c0 .203-.183.368-.409.368Z" fill="#D6D6D6" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M123.553 107.758a.399.399 0 0 1-.388.408h-5.068a.398.398 0 0 1-.387-.408c0-.226.173-.409.387-.409h5.068c.214 0 .388.183.388.409Zm-10.136 0a.398.398 0 0 1-.387.408h-5.068a.399.399 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.068c.214 0 .387.183.387.409Zm-10.136 0a.398.398 0 0 1-.387.408h-5.068a.398.398 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.068c.214 0 .387.183.387.409Zm-10.136 0a.398.398 0 0 1-.387.408H87.69a.398.398 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.068c.214 0 .387.183.387.409Zm-10.136 0a.398.398 0 0 1-.387.408h-5.068a.398.398 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.068c.214 0 .387.183.387.409Zm-10.135 0a.398.398 0 0 1-.388.408h-5.068a.398.398 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.068c.214 0 .388.183.388.409Zm-10.136 0a.398.398 0 0 1-.388.408h-5.068a.398.398 0 0 1-.387-.408c0-.226.173-.409.387-.409h5.068c.214 0 .388.183.388.409Zm-10.136 0a.398.398 0 0 1-.388.408h-5.068a.398.398 0 0 1-.387-.408c0-.226.173-.409.387-.409h5.068c.214 0 .388.183.388.409Zm-10.136 0a.398.398 0 0 1-.388.408H37.01a.398.398 0 0 1-.387-.408c0-.226.173-.409.387-.409h5.068c.214 0 .388.183.388.409Zm-10.136 0a.398.398 0 0 1-.388.408h-5.067a.398.398 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.067c.215 0 .388.183.388.409Zm-10.136 0a.398.398 0 0 1-.387.408h-5.068a.398.398 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.068c.214 0 .387.183.387.409Zm-10.136 0a.398.398 0 0 1-.387.408H6.603a.398.398 0 0 1-.388-.408c0-.226.174-.409.388-.409h5.068c.214 0 .387.183.387.409ZM123.553 21.434a.399.399 0 0 1-.388.409h-5.068a.398.398 0 0 1-.387-.409c0-.226.173-.408.387-.408h5.068c.214 0 .388.183.388.408Zm-10.136 0a.399.399 0 0 1-.388.409h-5.068a.398.398 0 0 1-.387-.409c0-.226.173-.408.387-.408h5.068c.214 0 .388.183.388.408Zm-10.136 0a.398.398 0 0 1-.387.409h-5.068a.399.399 0 0 1-.388-.409c0-.226.174-.408.388-.408h5.068c.214 0 .387.183.387.408Zm-10.136 0a.398.398 0 0 1-.387.409H87.69a.398.398 0 0 1-.388-.409c0-.226.174-.408.388-.408h5.068c.214 0 .387.183.387.408Zm-10.136 0a.398.398 0 0 1-.387.409h-5.068a.398.398 0 0 1-.388-.409c0-.226.174-.408.388-.408h5.068c.214 0 .387.183.387.408Zm-10.136 0a.398.398 0 0 1-.387.409h-5.068a.398.398 0 0 1-.388-.409c0-.226.174-.408.388-.408h5.068c.214 0 .387.183.387.408Zm-10.135 0a.399.399 0 0 1-.388.409h-5.068a.398.398 0 0 1-.387-.409c0-.226.173-.408.387-.408h5.068c.214 0 .388.183.388.408Zm-10.136 0a.398.398 0 0 1-.388.409h-5.068a.398.398 0 0 1-.387-.409c0-.226.173-.408.387-.408h5.068c.214 0 .388.183.388.408Zm-10.136 0a.398.398 0 0 1-.388.409H37.01a.398.398 0 0 1-.387-.409c0-.226.173-.408.387-.408h5.068c.214 0 .388.183.388.408Zm-10.136 0a.398.398 0 0 1-.388.409h-5.068a.398.398 0 0 1-.387-.409c0-.226.173-.408.387-.408h5.068c.214 0 .388.183.388.408Zm-10.136 0a.398.398 0 0 1-.388.409h-5.068a.398.398 0 0 1-.387-.409c0-.226.173-.408.387-.408h5.068c.214 0 .388.183.388.408Zm-10.136 0a.398.398 0 0 1-.387.409H6.603a.398.398 0 0 1-.388-.409c0-.226.174-.408.388-.408h5.068c.214 0 .387.183.387.408Z" fill="#D6D6D6" fill-rule="evenodd"></path><circle cx="65" cy="65" opacity=".5" r="64" stroke="#B6B6BD" stroke-dasharray="5.69 5.69" stroke-linecap="round" stroke-width=".854"></circle><g clip-path="url(#a)" stroke="#169FCC" stroke-miterlimit="10" stroke-width="1.42"><path d="m33.523 104.868-5.72-.695a1.214 1.214 0 0 1-.766-.386 1.182 1.182 0 0 1-.312-.788v-7.448c0-.095.038-.186.106-.253a.365.365 0 0 1 .256-.104l5.254-.263M61.471 22.733a1.761 1.761 0 0 1 1.45.235 49.628 49.628 0 0 1 15.613 17.6 48.797 48.797 0 0 1 5.65 22.702 47.236 47.236 0 0 1-.333 5.325 41.34 41.34 0 0 0-12.501-.441 48.503 48.503 0 0 0-1.813-23.734 49.117 49.117 0 0 0-12.91-20.119c1.602-.591 3.223-1.136 4.844-1.568Z"></path><path d="M71.35 68.154a39.493 39.493 0 0 0-10.813 3.757 51.298 51.298 0 0 0 3.251-18.062c0-9.392-4.939-19.179-9.783-27.237-.257-.432 0-1.616 2.642-2.32"></path><path d="M56.236 78.58a13.605 13.605 0 0 0-4.29-9.289 14.017 14.017 0 0 0-9.622-3.786 9.617 9.617 0 0 1-6.456-2.446 9.341 9.341 0 0 1-3.079-6.1l-.286-4.256c3.09 0 9.46 4.105 13.216 4.866 3.757.76 8.21.253 11.862 3.437a13.303 13.303 0 0 1 4.357 6.575"></path><path d="M68.594 75.442c-3.432 6.95-7.914 11.59-14.303 16.033a47.076 47.076 0 0 1-21.702 8.058v-4.696c11.642-4.809 22.208-11.806 27.948-22.88"></path><path d="M76.499 84.815a46.939 46.939 0 0 1-17.392 14.511 50.925 50.925 0 0 1-22.885 5.457c-2.317 0-3.662.47-3.662-.695v-4.555"></path><path d="M83.85 68.595c22.304 16.22 4.044 39.25-19.652 37.663.954-.939 29.95-22.222-3.661-34.3"></path><path d="M84.184 58.47c13.607 0 25.746 26.242 17.383 30.995-1.182-17.508-17.716-20.87-17.716-20.87"></path></g><defs><clipPath id="a"><path d="M0 0h79v85H0z" fill="#fff" transform="translate(26 22)"></path></clipPath></defs>',5)];function Jn(r,n){return e.openBlock(),e.createElementBlock("svg",Yn,Xn)}const Qn=U(qn,[["render",Jn]]),at=r=>(e.pushScopeId("data-v-ff05f71e"),r=r(),e.popScopeId(),r),ea={class:"kong-ui-app-error"},ta={class:"banana-icon"},na={class:"kong-ui-app-error-content"},aa=at(()=>e.createElementVNode("h2",null,"An unexpected error has occurred",-1)),ra=at(()=>e.createElementVNode("p",null,[e.createTextVNode("Go back to the previous page or "),e.createElementVNode("a",{href:"/"},"return home"),e.createTextVNode(".")],-1)),oa=e.defineComponent({__name:"AppError",setup(r){return(n,a)=>(e.openBlock(),e.createElementBlock("section",ea,[e.createElementVNode("div",ta,[e.createVNode(Qn)]),e.createElementVNode("div",na,[e.renderSlot(n.$slots,"default",{},()=>[aa,ra],!0)])]))}}),Zr="",jr="",ia=U(oa,[["__scopeId","data-v-ff05f71e"]]),ca={install:(r,n={})=>{r.component(n.name||"AppLayout",nt)}};R.AccountDropdown=Gn,R.AppError=ia,R.AppLayout=nt,R.AppNavbar=Me,R.AppSidebar=et,R.SidebarToggle=tt,R.default=ca,Object.defineProperties(R,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
12
- //# sourceMappingURL=app-layout.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/app-layout",
3
- "version": "0.19.6",
3
+ "version": "0.19.7-pr.524.170a3ca.0",
4
4
  "type": "module",
5
5
  "main": "./dist/app-layout.umd.js",
6
6
  "module": "./dist/app-layout.es.js",
@@ -22,7 +22,7 @@
22
22
  "peerDependencies": {
23
23
  "@kong/kongponents": "^8.76.0",
24
24
  "vue": "^3.2.47",
25
- "vue-router": "^4.2.1"
25
+ "vue-router": "^4.2.2"
26
26
  },
27
27
  "dependencies": {
28
28
  "focus-trap": "^7.4.3",
@@ -33,7 +33,7 @@
33
33
  "@kong/kongponents": "^8.76.0",
34
34
  "@types/lodash.clonedeep": "^4.5.7",
35
35
  "vue": "^3.2.47",
36
- "vue-router": "^4.2.1"
36
+ "vue-router": "^4.2.2"
37
37
  },
38
38
  "repository": {
39
39
  "type": "git",