UNPKG

@progress/kendo-vue-layout

Version:
9 lines (8 loc) 3.25 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"),L=require("./DrawerItem.js"),n=require("@progress/kendo-vue-common"),j=240,R=50,V={duration:200},_={duration:0},E=e.defineComponent({name:"KendoDrawerNavigation",props:{item:[Object],header:[Object],footer:[Object],content:[Object],tabIndex:Number,showLicenseWatermark:Boolean,licenseMessage:String,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=n.getDefaultSlots(this),{animation:i,expanded:l,mode:c,position:m,mini:s,dir:p,width:u,miniWidth:h,items:w}=this.kendoDrawer,D=this.$props.header,N=this.$props.footer,g=this.$props.content,t=typeof i!="boolean"?i:i===!1?_:V,f=u||j,k=h||R,I={opacity:1,flexBasis:f+"px",WebkitTransition:"all "+(t&&t.duration)+"ms",transition:"all "+(t&&t.duration)+"ms"},y={opacity:1,transform:"translateX(0px)",WebkitTransition:"all "+(t&&t.duration)+"ms",transition:"all "+(t&&t.duration)+"ms"},T={opacity:s?1:0,flexBasis:s?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(n.WatermarkOverlay,{message:this.licenseMessage},null):null,O=l?c==="push"?I:y:c==="push"?T:p==="ltr"&&m==="start"||p==="rtl"&&m==="end"?s?v:b:s?v:W,S=w&&e.createVNode("ul",{class:"k-drawer-items",role:"menubar","aria-orientation":"vertical","aria-expanded":l},[w.map(function(r,d){let o=this.$props.item;o&&!o.type&&!o.render&&(o=n.templateRendering.call(this,this.$props.item,n.getListeners.call(this)));const C=e.createVNode(L.DrawerItem,{key:d,index:d,onClick:this.onDrawerItemSelect,text:r.text,icon:r.icon,svgIcon:r.svgIcon,separator:r.separator,selected:r.selected,targetItem:r.targetItem},null);return n.getTemplate.call(this,{h:e.h,template:o,defaultRendering:C,additionalProps:{...r,index:d},additionalListeners:{click:this.onDrawerItemSelect}})},this),x]),A=n.getTemplate.call(this,{h:e.h,template:D}),M=n.getTemplate.call(this,{h:e.h,template:N}),$=n.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&&s&&c==="overlay"?{width:k+"px"}:{width:f+"px"}},[A,g?$:S||a,M])])},methods:{focus(a){this.$el&&this.$el.focus(a)},onDrawerItemSelect(a,i){this.$emit("select",a,i)}}});exports.DrawerNavigation=E;