@kong-ui-public/app-layout 0.11.5 → 0.11.6
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/app-layout.umd.js +1 -1
- package/package.json +3 -3
package/dist/app-layout.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/kongponents"],e):($=typeof globalThis<"u"?globalThis:$||self,e($["kong-ui-public-app-layout"]={},$.Vue,$.
|
|
1
|
+
(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/kongponents"],e):($=typeof globalThis<"u"?globalThis:$||self,e($["kong-ui-public-app-layout"]={},$.Vue,$.Kongponents))})(this,function($,e,ae){"use strict";const Nt={class:"kong-ui-app-navbar"},It={class:"header-content"},Bt={class:"mobile-header-left"},xt=e.defineComponent({__name:"AppNavbar",props:{topOffset:{type:Number,default:0},leftOffset:{type:Number,default:240},zIndex:{type:Number,default:3}},setup(r){const n=r;e.useCssVars(o=>({"769793c2":e.unref(a).top,a0e75924:e.unref(a).zIndex,"5c627706":e.unref(a).left}));const a=e.computed(()=>({top:n.topOffset?`${n.topOffset}px`:"0",left:n.leftOffset?`${n.leftOffset}px`:"0",zIndex:n.zIndex}));return(o,s)=>(e.openBlock(),e.createElementBlock("header",Nt,[e.createElementVNode("div",It,[e.createElementVNode("div",Bt,[e.renderSlot(o.$slots,"mobile-sidebar-toggle",{},void 0,!0),e.renderSlot(o.$slots,"mobile-logo",{},void 0,!0)]),e.renderSlot(o.$slots,"default",{},void 0,!0)])]))}}),Dr="",R=(r,n)=>{const a=r.__vccOpts||r;for(const[o,s]of n)a[o]=s;return a},Me=R(xt,[["__scopeId","data-v-bc6741e9"]]),Ot=["title"],At=e.defineComponent({__name:"ItemBadge",props:{count:{type:Number,required:!0,default:void 0}},setup(r){const n=r,a=99,o=e.computed(()=>n.count?n.count>a?`${a}+`:n.count.toString():"");return(s,f)=>e.unref(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"item-badge",title:(r.count||0)>a?String(r.count):void 0},e.toDisplayString(e.unref(o)),9,Ot)):e.createCommentVNode("",!0)}}),Vr="",$t=R(At,[["__scopeId","data-v-353c13e0"]]),Ft=["data-testid"],Dt=["aria-controls","aria-expanded","href","target","onClick","onKeypress"],Vt={key:0,class:"sidebar-item-icon"},Mt={class:"sidebar-item-name-container"},Lt={class:"sidebar-item-name has-tooltip"},Rt={key:2,class:"sidebar-item-label truncate-text truncate-20"},Zt=["id"],Pt=e.defineComponent({__name:"SidebarItem",props:{item:{type:Object,required:!0},subnavItem:{type:Boolean,default:!1}},emits:["click"],setup(r,{emit:n}){const a=r,o=e.computed(()=>typeof a.item.to!="string"?!1:!!a.item.newWindow||!!a.item.external||a.item.to.startsWith("http")),s=e.computed(()=>!a.item.to||typeof a.item.to!="string"||!a.item.newWindow?!1:a.item.newWindow&&(a.item.to.startsWith("http")||a.item.to.startsWith("/"))),f=e.computed(()=>a.subnavItem&&a.item.badgeCount!==void 0),l=_=>{n("click",_)},b=(_,v,N)=>{l(v),typeof N=="function"&&(_.preventDefault(),N())};return(_,v)=>{var E;const N=e.resolveComponent("SidebarItem",!0);return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([r.subnavItem?"sidebar-item-secondary":"sidebar-item-primary",{expanded:r.item.expanded},{active:r.item.active}]),"data-testid":r.item.testId?`sidebar-item-${r.item.testId}`:void 0},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)?"div":"router-link"),{custom:e.unref(o)?void 0:!0,to:!e.unref(o)&&!e.unref(s)?r.item.to:void 0},{default:e.withCtx(y=>{var w,x;return[e.createElementVNode("a",{"aria-controls":(w=r.item.items)!=null&&w.length&&r.item.expanded?`subnav-${r.item.key}`:void 0,"aria-expanded":(x=r.item.items)!=null&&x.length&&r.item.expanded?!0:void 0,class:e.normalizeClass(["sidebar-item-link",{"sidebar-item-external-link":e.unref(s),"router-link":!e.unref(o)}]),href:e.unref(o)?String(r.item.to||"#"):y==null?void 0:y.href,target:e.unref(s)?"_blank":void 0,onClick:F=>b(F,r.item,y==null?void 0:y.navigate),onKeypress:e.withKeys(F=>b(F,r.item,y==null?void 0:y.navigate),["enter"])},[e.createElementVNode("div",{class:e.normalizeClass(["sidebar-item-display",{"has-label":!!r.item.label&&r.item.expanded,"has-badge":e.unref(f)}])},[r.item.icon?(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(e.unref(ae.KIcon),{color:r.item.active||r.item.expanded?"var(--white, #fff)":"#B5BECD",icon:String(r.item.icon),size:"20"},null,8,["color","icon"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Mt,[(r.subnavItem?r.item.name.length<25:r.item.name.length<18)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sidebar-item-name truncate-text",[r.subnavItem?"has-badge-max-width truncate-24":"truncate-17"]])},e.toDisplayString(r.item.name),3)):(e.openBlock(),e.createBlock(e.unref(ae.KTooltip),{key:1,class:"sidebar-item-tooltip",label:r.item.name,placement:"right","position-fixed":""},{default:e.withCtx(()=>[e.createElementVNode("div",Lt,[e.createElementVNode("span",{class:e.normalizeClass(["truncate-text",[r.subnavItem?"truncate-20":"truncate-17",{"has-badge-max-width":e.unref(f)}]])},e.toDisplayString(r.item.name),3)])]),_:1},8,["label"])),r.item.label&&r.item.expanded?(e.openBlock(),e.createElementBlock("div",Rt,e.toDisplayString(r.item.label),1)):e.createCommentVNode("",!0)]),e.unref(f)?(e.openBlock(),e.createBlock($t,{key:1,count:r.item.badgeCount},null,8,["count"])):e.createCommentVNode("",!0)],2)],42,Dt)]}),_:1},8,["custom","to"])),(E=r.item.items)!=null&&E.length&&r.item.expanded?(e.openBlock(),e.createElementBlock("ul",{key:0,id:`subnav-${r.item.key}`,class:"level-secondary"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.item.items,y=>(e.openBlock(),e.createBlock(N,{key:y.name,item:y,"subnav-item":!0,onClick:w=>l(y)},null,8,["item","onClick"]))),128))],8,Zt)):e.createCommentVNode("",!0)],10,Ft)}}}),Mr="",Lr="",Le=R(Pt,[["__scopeId","data-v-37098230"]]),jt={},Ht={class:"profile-icon",fill:"none",height:"30",width:"30",xmlns:"http://www.w3.org/2000/svg"},zt=[e.createElementVNode("path",{d:"M0 15C0 6.716 6.716 0 15 0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15Z",fill:"#0A7FAE"},null,-1),e.createElementVNode("path",{d:"M12.613 15 8.5 18.115V23h13v-4.885L17.648 15h-5.035ZM15 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",fill:"#fff"},null,-1)];function Kt(r,n){return e.openBlock(),e.createElementBlock("svg",Ht,zt)}const Wt=R(jt,[["render",Kt]]),Gt={"aria-haspopup":"true","aria-label":"Profile Menu",class:"sidebar-footer"},Ut={class:"sidebar-profile-link"},qt={class:"sidebar-item-icon"},Yt={class:"sidebar-profile-item-container"},Xt={class:"sidebar-profile-dropdown-container"},Jt={key:0,class:"sidebar-profile-name"},Qt={class:"sidebar-profile-name"},en=e.defineComponent({__name:"SidebarFooter",props:{name:{type:String,required:!0},itemCount:{type:Number,required:!0,default:0}},setup(r){const n=r,a=e.computed(()=>n.itemCount>0);return(o,s)=>(e.openBlock(),e.createElementBlock("nav",Gt,[e.createElementVNode("div",Ut,[e.createElementVNode("div",qt,[e.createVNode(Wt)]),e.createElementVNode("div",Yt,[e.createElementVNode("div",Xt,[e.unref(a)?(e.openBlock(),e.createBlock(e.unref(ae.KDropdownMenu),{key:1,"kpop-attributes":{placement:"right",popoverClasses:"ml-5 sidebar-profile-menu-popover",target:".sidebar-footer"},width:"240"},{items:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},void 0,!0)]),default:e.withCtx(()=>[e.createElementVNode("a",{"aria-label":"Open Profile Menu",class:"profile-dropdown-trigger",role:"button",tabindex:"0",onClick:s[0]||(s[0]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("span",Qt,e.toDisplayString(r.name),1)])]),_:3},8,["kpop-attributes"])):(e.openBlock(),e.createElementBlock("div",Jt,e.toDisplayString(r.name),1))])])])]))}}),Pr="",tn=R(en,[["__scopeId","data-v-b53ca5d3"]]);/*!
|
|
2
2
|
* tabbable 6.0.1
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
4
|
*/var Re=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],se=Re.join(","),Ze=typeof Element>"u",U=Ze?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,de=!Ze&&Element.prototype.getRootNode?function(r){return r.getRootNode()}:function(r){return r.ownerDocument},Pe=function(n,a,o){var s=Array.prototype.slice.apply(n.querySelectorAll(se));return a&&U.call(n,se)&&s.unshift(n),s=s.filter(o),s},je=function r(n,a,o){for(var s=[],f=Array.from(n);f.length;){var l=f.shift();if(l.tagName==="SLOT"){var b=l.assignedElements(),_=b.length?b:l.children,v=r(_,!0,o);o.flatten?s.push.apply(s,v):s.push({scopeParent:l,candidates:v})}else{var N=U.call(l,se);N&&o.filter(l)&&(a||!n.includes(l))&&s.push(l);var E=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),y=!o.shadowRootFilter||o.shadowRootFilter(l);if(E&&y){var w=r(E===!0?l.children:E.children,!0,o);o.flatten?s.push.apply(s,w):s.push({scopeParent:l,candidates:w})}else f.unshift.apply(f,l.children)}}return s},He=function(n,a){return n.tabIndex<0&&(a||/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||n.isContentEditable)&&isNaN(parseInt(n.getAttribute("tabindex"),10))?0:n.tabIndex},nn=function(n,a){return n.tabIndex===a.tabIndex?n.documentOrder-a.documentOrder:n.tabIndex-a.tabIndex},ze=function(n){return n.tagName==="INPUT"},an=function(n){return ze(n)&&n.type==="hidden"},rn=function(n){var a=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return a},on=function(n,a){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===a)return n[o]},cn=function(n){if(!n.name)return!0;var a=n.form||de(n),o=function(b){return a.querySelectorAll('input[type="radio"][name="'+b+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=o(window.CSS.escape(n.name));else try{s=o(n.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var f=on(s,n.form);return!f||f===n},ln=function(n){return ze(n)&&n.type==="radio"},sn=function(n){return ln(n)&&!cn(n)},dn=function(n){for(var a,o=de(n).host,s=!!((a=o)!==null&&a!==void 0&&a.ownerDocument.contains(o)||n.ownerDocument.contains(n));!s&&o;){var f;o=de(o).host,s=!!((f=o)!==null&&f!==void 0&&f.ownerDocument.contains(o))}return s},Ke=function(n){var a=n.getBoundingClientRect(),o=a.width,s=a.height;return o===0&&s===0},fn=function(n,a){var o=a.displayCheck,s=a.getShadowRoot;if(getComputedStyle(n).visibility==="hidden")return!0;var f=U.call(n,"details>summary:first-of-type"),l=f?n.parentElement:n;if(U.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof s=="function"){for(var b=n;n;){var _=n.parentElement,v=de(n);if(_&&!_.shadowRoot&&s(_)===!0)return Ke(n);n.assignedSlot?n=n.assignedSlot:!_&&v!==n.ownerDocument?n=v.host:n=_}n=b}if(dn(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Ke(n);return!1},un=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var a=n.parentElement;a;){if(a.tagName==="FIELDSET"&&a.disabled){for(var o=0;o<a.children.length;o++){var s=a.children.item(o);if(s.tagName==="LEGEND")return U.call(a,"fieldset[disabled] *")?!0:!s.contains(n)}return!0}a=a.parentElement}return!1},fe=function(n,a){return!(a.disabled||an(a)||fn(a,n)||rn(a)||un(a))},ke=function(n,a){return!(sn(a)||He(a)<0||!fe(n,a))},pn=function(n){var a=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(a)||a>=0)},mn=function r(n){var a=[],o=[];return n.forEach(function(s,f){var l=!!s.scopeParent,b=l?s.scopeParent:s,_=He(b,l),v=l?r(s.candidates):b;_===0?l?a.push.apply(a,v):a.push(b):o.push({documentOrder:f,tabIndex:_,item:s,isScope:l,content:v})}),o.sort(nn).reduce(function(s,f){return f.isScope?s.push.apply(s,f.content):s.push(f.content),s},[]).concat(a)},bn=function(n,a){a=a||{};var o;return a.getShadowRoot?o=je([n],a.includeContainer,{filter:ke.bind(null,a),flatten:!1,getShadowRoot:a.getShadowRoot,shadowRootFilter:pn}):o=Pe(n,a.includeContainer,ke.bind(null,a)),mn(o)},hn=function(n,a){a=a||{};var o;return a.getShadowRoot?o=je([n],a.includeContainer,{filter:fe.bind(null,a),flatten:!0,getShadowRoot:a.getShadowRoot}):o=Pe(n,a.includeContainer,fe.bind(null,a)),o},ue=function(n,a){if(a=a||{},!n)throw new Error("No node provided");return U.call(n,se)===!1?!1:ke(a,n)},gn=Re.concat("iframe").join(","),Ce=function(n,a){if(a=a||{},!n)throw new Error("No node provided");return U.call(n,gn)===!1?!1:fe(a,n)};/*!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/app-layout",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/app-layout.umd.js",
|
|
6
6
|
"module": "./dist/app-layout.es.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@kong/kongponents": "^8.
|
|
23
|
+
"@kong/kongponents": "^8.20.0",
|
|
24
24
|
"vue": "^3.2.45",
|
|
25
25
|
"vue-router": "^4.1.6"
|
|
26
26
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lodash.clonedeep": "^4.5.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@kong/kongponents": "^8.
|
|
33
|
+
"@kong/kongponents": "^8.20.0",
|
|
34
34
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
35
35
|
"vue": "^3.2.45",
|
|
36
36
|
"vue-router": "^4.1.6"
|