@progress/kendo-vue-animation
Version:
Kendo UI for Vue Animation package
9 lines (8 loc) • 2.55 kB
JavaScript
/**
* @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 i=require("vue"),s=require("./Animation.js"),o=require("./util.js"),l=require("@progress/kendo-vue-common");function p(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!i.isVNode(t)}const u=function(){},c=i.defineComponent({props:{appear:{type:Boolean,default:!1},enter:{type:Boolean,default:!0},exit:{type:Boolean,default:!0},transitionEnterDuration:{type:Number,default:300},transitionExitDuration:{type:Number,default:300},componentChildStyle:Object,childFactory:Object,className:String,direction:{type:String,default:"vertical"},tag:String,id:String,onEnter:Function,onEntering:Function,onExit:Function,onExited:Function},data(){return{maxHeight:"",maxWidth:""}},methods:{componentWillEnter(t){const{onEnter:n}=this.$props;this.updateContainerDimensions(t.animatedElement,()=>{n&&n.call(void 0,t)})},componentIsEntering(t){const{onEntering:n}=this.$props;this.updateContainerDimensions(t.animatedElement,()=>{n&&n.call(void 0,t)})},componentWillExit(t){const{onExit:n}=this.$props;this.updateContainerDimensions(t.animatedElement,()=>{n&&n.call(void 0,t)})},updateContainerDimensions(t,n=u){const e=t?t.firstElementChild:null;if(e){const r=o.outerHeight(e),a=o.outerWidth(e);this.$data.maxHeight=r,this.$data.maxWidth=a,n()}}},computed:{animationEnteringStyle(){let t;return this.$props.direction==="vertical"?t={maxHeight:this.maxHeight?`${this.maxHeight}px`:null}:t={maxWidth:this.maxWidth?`${this.maxWidth}px`:null},{maxHeight:t.maxHeight,maxWidth:t.maxWidth}}},render(){const t=l.getDefaultSlots(this);this.$props;const n=`reveal-${this.$props.direction}`;return i.createVNode(s.Animation,{appear:this.$props.appear,enter:this.$props.enter,exit:this.$props.exit,transitionEnterDuration:this.$props.transitionEnterDuration,transitionExitDuration:this.$props.transitionExitDuration,onEnter:this.componentWillEnter,onEntering:this.componentIsEntering,onExit:this.componentWillExit,componentChildStyle:this.$props.componentChildStyle,animationEnteringStyle:this.animationEnteringStyle,transitionName:n},p(t)?t:{default:()=>[t]})}});exports.Reveal=c;