UNPKG

@visactor/vrender-components

Version:

components library for dp visualization

21 lines (19 loc) 1.15 kB
import { AbstractComponent } from "../core/base"; import { isArray, isObject, merge } from "@visactor/vutils"; export class AnimateComponent extends AbstractComponent { _prepareAnimate(defaultAnimation) { if (!1 !== this.attribute.animation) { const {animation: animation, animationEnter: animationEnter, animationExit: animationExit, animationUpdate: animationUpdate} = this.attribute, animationCfg = isObject(animation) ? animation : {}; this._animationConfig = { enter: !1 !== animationEnter && merge({}, defaultAnimation, animationCfg, null != animationEnter ? animationEnter : {}), exit: !1 !== animationExit && merge({}, defaultAnimation, animationCfg, null != animationExit ? animationExit : {}), update: !1 !== animationUpdate && (isArray(animationUpdate) ? animationUpdate : merge({}, defaultAnimation, animationCfg, null != animationUpdate ? animationUpdate : {})) }; } else this._animationConfig = { enter: !1, exit: !1, update: !1 }; } } //# sourceMappingURL=animate-component.js.map