UNPKG

@progress/kendo-vue-layout

Version:
9 lines (8 loc) 3.23 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),j=require("./DrawerItem.js"),r=require("@progress/kendo-vue-common"),M=240,R=50,V={type:"slide",duration:200},_={type:"slide",duration:0},E=e.defineComponent({name:"KendoDrawerNavigation",props:{item:[Object],header:[Object],footer:[Object],content:[Object],tabIndex:Number,showLicenseWatermark:Boolean,onSelect:Function},inject:{kendoDrawer:{default:null}},computed:{navigationClassNames(){const{position:a}=this.kendoDrawer;return{"k-widget k-drawer":!0,"k-drawer-start":a==="start","k-drawer-end":a==="end"}}},render(){const a=r.getDefaultSlots(this),{animation:i,expanded:l,mode:c,position:m,mini:o,dir:p,width:u,miniWidth:h,items:w}=this.kendoDrawer,D=this.$props.header,y=this.$props.footer,g=this.$props.content,t=typeof i!="boolean"?i:i===!1?_:V,f=u||M,k=h||R,N={opacity:1,flexBasis:f+"px",WebkitTransition:"all "+(t&&t.duration)+"ms",transition:"all "+(t&&t.duration)+"ms"},I={opacity:1,transform:"translateX(0px)",WebkitTransition:"all "+(t&&t.duration)+"ms",transition:"all "+(t&&t.duration)+"ms"},T={opacity:o?1:0,flexBasis:o?k+"px":0,WebkitTransition:"all "+(t&&t.duration)+"ms",transition:"all "+(t&&t.duration)+"ms"},b={opacity:0,transform:"translateX(-100%)",WebkitTransition:"all "+(t&&t.duration)+"ms",transition:"all "+(t&&t.duration)+"ms"},W={opacity:0,transform:"translateX(100%)",WebkitTransition:"all "+(t&&t.duration)+"ms",transition:"all "+(t&&t.duration)+"ms"},v={transform:"translateX(0%)",WebkitTransitionDuration:(t&&t.duration)+"ms",transitionDuration:(t&&t.duration)+"ms"},x=this.showLicenseWatermark?e.createVNode(r.WatermarkOverlay,null,null):null,O=l?c==="push"?N:I:c==="push"?T:p==="ltr"&&m==="start"||p==="rtl"&&m==="end"?o?v:b:o?v:W,A=w&&e.createVNode("ul",{class:"k-drawer-items",role:"menubar","aria-orientation":"vertical","aria-expanded":l},[w.map(function(n,d){let s=this.$props.item;s&&!s.type&&!s.render&&(s=r.templateRendering.call(this,this.$props.item,r.getListeners.call(this)));const L=e.createVNode(j.DrawerItem,{key:d,index:d,onClick:this.onDrawerItemSelect,text:n.text,icon:n.icon,svgIcon:n.svgIcon,separator:n.separator,selected:n.selected,targetItem:n.targetItem},null);return r.getTemplate.call(this,{h:e.h,template:s,defaultRendering:L,additionalProps:{...n,index:d},additionalListeners:{click:this.onDrawerItemSelect}})},this),x]),S=r.getTemplate.call(this,{h:e.h,template:D}),$=r.getTemplate.call(this,{h:e.h,template:y}),C=r.getTemplate.call(this,{h:e.h,template:g});return e.createVNode("div",{style:O,class:this.navigationClassNames},[e.createVNode("div",{class:"k-drawer-wrapper",style:!l&&o&&c==="overlay"?{width:k+"px"}:{width:f+"px"}},[S,g?C:A||a,$])])},methods:{focus(a){this.$el&&this.$el.focus(a)},onDrawerItemSelect(a,i){this.$emit("select",a,i)}}});exports.DrawerNavigation=E;