@proyecto26/animatable-component
Version:
Animate once, use Everywhere! 💫
38 lines (33 loc) • 2.58 kB
JavaScript
Object.defineProperty(exports, '__esModule', { value: true });
const index$1 = require('./index-d79ac560.js');
const index = require('./index-51860223.js');
var __rest = (undefined && undefined.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
/**
* HOC to wrap components with Animatable component
* @param WrappedComponent - Component to be animated with Animatable component
*/
function createAnimatableComponent(WrappedComponent) {
return (props) => {
const { ref, animation, keyFrames, keyFramesData, options, optionsData, animateId, delay, endDelay, duration, direction, composite, easing, fill, iterations, iterationStart, iterationComposite, autoPlay, fromClassName, toClassName, currentTime, startTime, playbackRate, onStart, onFinish, onCancel } = props, rest = __rest(props, ["ref", "animation", "keyFrames", "keyFramesData", "options", "optionsData", "animateId", "delay", "endDelay", "duration", "direction", "composite", "easing", "fill", "iterations", "iterationStart", "iterationComposite", "autoPlay", "fromClassName", "toClassName", "currentTime", "startTime", "playbackRate", "onStart", "onFinish", "onCancel"]);
return index$1.h("animatable-component", { ref: ref, animation: animation, keyFrames: keyFrames, keyFramesData: keyFramesData, options: options, optionsData: optionsData, animateId: animateId, delay: delay, endDelay: endDelay, duration: duration, direction: direction, composite: composite, easing: easing, fill: fill, iterations: iterations, iterationStart: iterationStart, iterationComposite: iterationComposite, autoPlay: autoPlay, fromClassName: fromClassName, toClassName: toClassName, currentTime: currentTime, startTime: startTime, playbackRate: playbackRate, onStart: onStart, onFinish: onFinish, onCancel: onCancel },
index$1.h(WrappedComponent, Object.assign({}, rest)));
};
}
exports.ANIMATIONS = index.ANIMATIONS;
exports.ANIMATION_KEY_ERROR = index.ANIMATION_KEY_ERROR;
exports.EASING = index.EASING;
exports.EASING_FUNCTIONS = index.EASING_FUNCTIONS;
exports.KEYFRAMES = index.KEYFRAMES;
exports.getKeyFramesByAnimation = index.getKeyFramesByAnimation;
exports.createAnimatableComponent = createAnimatableComponent;
;