@progress/kendo-react-animation 10.2.0-develop.2 → 10.2.0-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-animation.js +1 -1
- package/hooks/useAnimation.js +1 -1
- package/hooks/useAnimation.mjs +8 -8
- package/index.d.mts +8 -8
- package/index.d.ts +8 -8
- package/package.json +2 -2
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("react-transition-group")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","react-transition-group"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).KendoReactAnimation={},t.React,t.PropTypes,t.KendoReactCommon,t.ReactTransitionGroup)}(this,(function(t,n,e,i,r){"use strict";function a(t){var n=Object.create(null);return t&&Object.keys(t).forEach((function(e){if("default"!==e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}})),n.default=t,Object.freeze(n)}var o=a(n);const s=o.forwardRef(((t,n)=>{const e=o.useRef(null),{mountOnEnter:a=c.mountOnEnter,unmountOnExit:s=c.unmountOnExit,onEnter:l=c.onEnter,onEntering:u=c.onEntering,onEntered:d=c.onEntered,onExit:m=c.onExit,onExiting:p=c.onExiting,onExited:E=c.onExited,onAfterExited:x=c.onAfterExited,animationEnteringStyle:y=c.animationEnteringStyle,animationEnteredStyle:f=c.animationEnteredStyle,animationExitingStyle:g=c.animationExitingStyle,animationExitedStyle:h=c.animationExitedStyle,children:D,style:N,appear:O,enter:v,exit:S,transitionName:b,transitionEnterDuration:A,transitionExitDuration:C,className:R,unstyled:T,...w}=t,F={transitionDelay:"0ms",...N},k=T&&T.uAnimation,q=i.classNames(R,i.uAnimation.childContainer({c:k})),j=o.useRef({element:e.current,props:t}),$=o.useRef(null);o.useImperativeHandle($,(()=>({element:e.current,props:t}))),o.useImperativeHandle(n,(()=>$.current),[]);const H={entering:{transitionDuration:`${A}ms`,...y},entered:{...f},exiting:{transitionDuration:`${C}ms`,...g},exited:{...h}},W={in:t.in,appear:O,enter:v,exit:S,mountOnEnter:a,unmountOnExit:s,timeout:{enter:A,exit:C},onEnter:()=>{l&&l.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntering:()=>{u&&u.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntered:()=>{d&&d.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExit:()=>{m&&m.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExiting:()=>{p&&p.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExited:()=>{x&&x.call(void 0,{animatedElement:e.current,target:$.current||j.current}),E&&E.call(void 0,{animatedElement:e.current,target:$.current||j.current})},classNames:{appear:i.classNames(i.uAnimation.appear({c:k,transitionName:b})),appearActive:i.classNames(i.uAnimation.appearActive({c:k,transitionName:b})),enter:i.classNames(i.uAnimation.enter({c:k,transitionName:b})),enterActive:i.classNames(i.uAnimation.enterActive({c:k,transitionName:b})),exit:i.classNames(i.uAnimation.exit({c:k,transitionName:b})),exitActive:i.classNames(i.uAnimation.exitActive({c:k,transitionName:b}))}};return o.createElement(r.CSSTransition,{...W,...w,nodeRef:e},(t=>o.createElement("div",{style:{...F,...H[t]},className:q,ref:t=>{e.current=t,j.current.element=t}},D)))})),c={mountOnEnter:!0,unmountOnExit:!1,onEnter:i.noop,onEntering:i.noop,onEntered:i.noop,onExit:i.noop,onExiting:i.noop,onExited:i.noop,onAfterExited:i.noop,animationEnteringStyle:{},animationEnteredStyle:{},animationExitingStyle:{},animationExitedStyle:{}};s.displayName="KendoReactAnimationChild",s.propTypes={in:e.bool,children:e.oneOfType([e.arrayOf(e.node),e.node]),transitionName:e.string.isRequired,className:e.string,appear:e.bool,enter:e.bool,exit:e.bool,transitionEnterDuration:e.number.isRequired,transitionExitDuration:e.number.isRequired,mountOnEnter:e.bool,unmountOnExit:e.bool,animationEnteringStyle:e.object,animationEnteredStyle:e.object,animationExitingStyle:e.object,animationExitedStyle:e.object};const l=t=>{const{id:n,style:e,children:a,component:c="div",className:l,childFactory:u,stackChildren:d,componentChildStyle:m,componentChildClassName:p,...E}=t,x=i.useUnstyled(),y=t.unstyled||x,f=y&&y.uAnimation,g={id:n,style:e,component:c,childFactory:u,className:i.classNames(i.uAnimation.child({c:f}),l)},h=o.Children.map(a||null,(t=>o.createElement(s,{...E,unstyled:y,style:m,className:p},t)));return o.createElement(r.TransitionGroup,{...g},h)};l.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,component:e.string,id:e.string,style:e.any,transitionName:e.string.isRequired,appear:e.bool.isRequired,enter:e.bool.isRequired,exit:e.bool.isRequired,transitionEnterDuration:e.number.isRequired,transitionExitDuration:e.number.isRequired};const u=t=>{const{appear:n=d.appear,enter:e=d.enter,exit:i=d.exit,transitionEnterDuration:r=d.transitionEnterDuration,transitionExitDuration:a=d.transitionExitDuration,children:s,...c}=t;return o.createElement(l,{transitionName:"fade",appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...c},s)},d={appear:!1,enter:!0,exit:!1,transitionEnterDuration:500,transitionExitDuration:500};u.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,component:e.string,id:e.string,style:e.any};const m=t=>{const{appear:n=p.appear,enter:e=p.enter,exit:i=p.exit,transitionEnterDuration:r=p.transitionEnterDuration,transitionExitDuration:a=p.transitionExitDuration,direction:s=p.direction,children:c,...u}=t,d={transitionName:`expand-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},p={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};m.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};const E={position:"absolute",top:"0",left:"0"},x=t=>{const{appear:n=y.appear,enter:e=y.enter,exit:i=y.exit,transitionEnterDuration:r=y.transitionEnterDuration,transitionExitDuration:a=y.transitionExitDuration,stackChildren:s=y.stackChildren,direction:c=y.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`push-${c}`,animationExitingStyle:t.stackChildren?E:void 0},u)},y={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"right",stackChildren:!1};x.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const f=t=>{const{appear:n=g.appear,enter:e=g.enter,exit:i=g.exit,transitionEnterDuration:r=g.transitionEnterDuration,transitionExitDuration:a=g.transitionExitDuration,direction:s=g.direction,children:c,...u}=t,d={transitionName:`slide-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},g={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"down"};f.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any};const h={position:"absolute",top:"0",left:"0"},D=t=>{const{appear:n=N.appear,enter:e=N.enter,exit:i=N.exit,transitionEnterDuration:r=N.transitionEnterDuration,transitionExitDuration:a=N.transitionExitDuration,stackChildren:s=N.stackChildren,direction:c=N.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`zoom-${c}`,animationExitingStyle:t.stackChildren?h:void 0},u)},N={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"out",stackChildren:!1};D.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["in","out"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const O=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginTop),i=parseFloat(n.marginBottom);return t.offsetHeight+e+i},v=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginLeft),i=parseFloat(n.marginRight);return t.offsetWidth+e+i},S=(i.animationStyles,t=>{const[n,e]=o.useState(),[i,r]=o.useState(),[a,s]=o.useState({}),{appear:c=b.appear,enter:u=b.enter,exit:d=b.exit,transitionEnterDuration:m=b.transitionEnterDuration,transitionExitDuration:p=b.transitionExitDuration,direction:E=b.direction,children:x,childFactory:y,...f}=t;let g;g="vertical"===E?{maxHeight:n?`${n}px`:""}:{maxWidth:i?`${i}px`:""};const h={maxHeight:g.maxHeight,maxWidth:g.maxWidth};o.useEffect((()=>{t&&a.name&&t[a.name]&&t[a.name].call(void 0,a.event)}),[n,i,a]);const D=(t,n)=>{const i=t.animatedElement.firstChild;if(i){const a=O(i),o=v(i);e(a),r(o),s({name:n,event:t})}};return o.createElement(l,{...f,appear:c,enter:u,exit:d,transitionEnterDuration:m,transitionExitDuration:p,childFactory:t=>{const n=y?y(t):t;return n.props.in?n:o.cloneElement(n,{...n.props,style:{...n.props.style,maxHeight:g.maxHeight,maxWidth:g.maxWidth}})},onEnter:n=>{const{onBeforeEnter:e}=t;e&&e.call(void 0,n),D(n,"onEnter")},onEntering:t=>{D(t,"onEntering")},onExit:t=>{D(t,"onExit")},animationEnteringStyle:h,transitionName:`reveal-${E}`},x)}),b={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};S.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};t.Animation=l,t.AnimationChild=s,t.Expand=m,t.Fade=u,t.Push=x,t.Reveal=S,t.Slide=f,t.Zoom=D,t.useAnimation=(t,n)=>{const e=o.useRef(0),i=o.useRef(!1),r=o.useRef();o.useEffect((()=>((t=>{const n=t.duration;let i,a;const o=e.current&&1-e.current;t.onStart&&t.onStart();const s=c=>{i||(i=c),a=c-i+1;const l=a/n+o;l<=1?(t.onUpdate&&t.onUpdate(l),r.current=window.requestAnimationFrame(s),e.current=l):(t.onEnd&&t.onEnd(1),e.current=0)};r.current=window.requestAnimationFrame(s)})(t),()=>{r.current&&window.cancelAnimationFrame(r.current)})),n),o.useEffect((()=>{i.current=!0}),[])}}));
|
|
15
|
+
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("react-transition-group")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","react-transition-group"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).KendoReactAnimation={},t.React,t.PropTypes,t.KendoReactCommon,t.ReactTransitionGroup)}(this,(function(t,n,e,i,r){"use strict";function a(t){var n=Object.create(null);return t&&Object.keys(t).forEach((function(e){if("default"!==e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}})),n.default=t,Object.freeze(n)}var o=a(n);const s=o.forwardRef(((t,n)=>{const e=o.useRef(null),{mountOnEnter:a=c.mountOnEnter,unmountOnExit:s=c.unmountOnExit,onEnter:l=c.onEnter,onEntering:u=c.onEntering,onEntered:d=c.onEntered,onExit:m=c.onExit,onExiting:p=c.onExiting,onExited:E=c.onExited,onAfterExited:x=c.onAfterExited,animationEnteringStyle:y=c.animationEnteringStyle,animationEnteredStyle:f=c.animationEnteredStyle,animationExitingStyle:g=c.animationExitingStyle,animationExitedStyle:h=c.animationExitedStyle,children:D,style:N,appear:O,enter:v,exit:S,transitionName:b,transitionEnterDuration:A,transitionExitDuration:C,className:R,unstyled:T,...w}=t,F={transitionDelay:"0ms",...N},k=T&&T.uAnimation,q=i.classNames(R,i.uAnimation.childContainer({c:k})),j=o.useRef({element:e.current,props:t}),$=o.useRef(null);o.useImperativeHandle($,(()=>({element:e.current,props:t}))),o.useImperativeHandle(n,(()=>$.current),[]);const H={entering:{transitionDuration:`${A}ms`,...y},entered:{...f},exiting:{transitionDuration:`${C}ms`,...g},exited:{...h}},W={in:t.in,appear:O,enter:v,exit:S,mountOnEnter:a,unmountOnExit:s,timeout:{enter:A,exit:C},onEnter:()=>{l&&l.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntering:()=>{u&&u.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntered:()=>{d&&d.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExit:()=>{m&&m.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExiting:()=>{p&&p.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExited:()=>{x&&x.call(void 0,{animatedElement:e.current,target:$.current||j.current}),E&&E.call(void 0,{animatedElement:e.current,target:$.current||j.current})},classNames:{appear:i.classNames(i.uAnimation.appear({c:k,transitionName:b})),appearActive:i.classNames(i.uAnimation.appearActive({c:k,transitionName:b})),enter:i.classNames(i.uAnimation.enter({c:k,transitionName:b})),enterActive:i.classNames(i.uAnimation.enterActive({c:k,transitionName:b})),exit:i.classNames(i.uAnimation.exit({c:k,transitionName:b})),exitActive:i.classNames(i.uAnimation.exitActive({c:k,transitionName:b}))}};return o.createElement(r.CSSTransition,{...W,...w,nodeRef:e},(t=>o.createElement("div",{style:{...F,...H[t]},className:q,ref:t=>{e.current=t,j.current.element=t}},D)))})),c={mountOnEnter:!0,unmountOnExit:!1,onEnter:i.noop,onEntering:i.noop,onEntered:i.noop,onExit:i.noop,onExiting:i.noop,onExited:i.noop,onAfterExited:i.noop,animationEnteringStyle:{},animationEnteredStyle:{},animationExitingStyle:{},animationExitedStyle:{}};s.displayName="KendoReactAnimationChild",s.propTypes={in:e.bool,children:e.oneOfType([e.arrayOf(e.node),e.node]),transitionName:e.string.isRequired,className:e.string,appear:e.bool,enter:e.bool,exit:e.bool,transitionEnterDuration:e.number.isRequired,transitionExitDuration:e.number.isRequired,mountOnEnter:e.bool,unmountOnExit:e.bool,animationEnteringStyle:e.object,animationEnteredStyle:e.object,animationExitingStyle:e.object,animationExitedStyle:e.object};const l=t=>{const{id:n,style:e,children:a,component:c="div",className:l,childFactory:u,stackChildren:d,componentChildStyle:m,componentChildClassName:p,...E}=t,x=i.useUnstyled(),y=t.unstyled||x,f=y&&y.uAnimation,g={id:n,style:e,component:c,childFactory:u,className:i.classNames(i.uAnimation.child({c:f}),l)},h=o.Children.map(a||null,(t=>o.createElement(s,{...E,unstyled:y,style:m,className:p},t)));return o.createElement(r.TransitionGroup,{...g},h)};l.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,component:e.string,id:e.string,style:e.any,transitionName:e.string.isRequired,appear:e.bool.isRequired,enter:e.bool.isRequired,exit:e.bool.isRequired,transitionEnterDuration:e.number.isRequired,transitionExitDuration:e.number.isRequired};const u=t=>{const{appear:n=d.appear,enter:e=d.enter,exit:i=d.exit,transitionEnterDuration:r=d.transitionEnterDuration,transitionExitDuration:a=d.transitionExitDuration,children:s,...c}=t;return o.createElement(l,{transitionName:"fade",appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...c},s)},d={appear:!1,enter:!0,exit:!1,transitionEnterDuration:500,transitionExitDuration:500};u.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,component:e.string,id:e.string,style:e.any};const m=t=>{const{appear:n=p.appear,enter:e=p.enter,exit:i=p.exit,transitionEnterDuration:r=p.transitionEnterDuration,transitionExitDuration:a=p.transitionExitDuration,direction:s=p.direction,children:c,...u}=t,d={transitionName:`expand-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},p={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};m.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};const E={position:"absolute",top:"0",left:"0"},x=t=>{const{appear:n=y.appear,enter:e=y.enter,exit:i=y.exit,transitionEnterDuration:r=y.transitionEnterDuration,transitionExitDuration:a=y.transitionExitDuration,stackChildren:s=y.stackChildren,direction:c=y.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`push-${c}`,animationExitingStyle:t.stackChildren?E:void 0},u)},y={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"right",stackChildren:!1};x.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const f=t=>{const{appear:n=g.appear,enter:e=g.enter,exit:i=g.exit,transitionEnterDuration:r=g.transitionEnterDuration,transitionExitDuration:a=g.transitionExitDuration,direction:s=g.direction,children:c,...u}=t,d={transitionName:`slide-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},g={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"down"};f.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any};const h={position:"absolute",top:"0",left:"0"},D=t=>{const{appear:n=N.appear,enter:e=N.enter,exit:i=N.exit,transitionEnterDuration:r=N.transitionEnterDuration,transitionExitDuration:a=N.transitionExitDuration,stackChildren:s=N.stackChildren,direction:c=N.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`zoom-${c}`,animationExitingStyle:t.stackChildren?h:void 0},u)},N={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"out",stackChildren:!1};D.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["in","out"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const O=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginTop),i=parseFloat(n.marginBottom);return t.offsetHeight+e+i},v=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginLeft),i=parseFloat(n.marginRight);return t.offsetWidth+e+i},S=(i.animationStyles,t=>{const[n,e]=o.useState(),[i,r]=o.useState(),[a,s]=o.useState({}),{appear:c=b.appear,enter:u=b.enter,exit:d=b.exit,transitionEnterDuration:m=b.transitionEnterDuration,transitionExitDuration:p=b.transitionExitDuration,direction:E=b.direction,children:x,childFactory:y,...f}=t;let g;g="vertical"===E?{maxHeight:n?`${n}px`:""}:{maxWidth:i?`${i}px`:""};const h={maxHeight:g.maxHeight,maxWidth:g.maxWidth};o.useEffect((()=>{t&&a.name&&t[a.name]&&t[a.name].call(void 0,a.event)}),[n,i,a]);const D=(t,n)=>{const i=t.animatedElement.firstChild;if(i){const a=O(i),o=v(i);e(a),r(o),s({name:n,event:t})}};return o.createElement(l,{...f,appear:c,enter:u,exit:d,transitionEnterDuration:m,transitionExitDuration:p,childFactory:t=>{const n=y?y(t):t;return n.props.in?n:o.cloneElement(n,{...n.props,style:{...n.props.style,maxHeight:g.maxHeight,maxWidth:g.maxWidth}})},onEnter:n=>{const{onBeforeEnter:e}=t;e&&e.call(void 0,n),D(n,"onEnter")},onEntering:t=>{D(t,"onEntering")},onExit:t=>{D(t,"onExit")},animationEnteringStyle:h,transitionName:`reveal-${E}`},x)}),b={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};S.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};t.Animation=l,t.AnimationChild=s,t.Expand=m,t.Fade=u,t.Push=x,t.Reveal=S,t.Slide=f,t.Zoom=D,t.useAnimation=(t,n)=>{const e=o.useRef(0),i=o.useRef(!1),r=o.useRef(null);o.useEffect((()=>((t=>{const n=t.duration;let i,a;const o=e.current&&1-e.current;t.onStart&&t.onStart();const s=c=>{i||(i=c),a=c-i+1;const l=a/n+o;l<=1?(t.onUpdate&&t.onUpdate(l),r.current=window.requestAnimationFrame(s),e.current=l):(t.onEnd&&t.onEnd(1),e.current=0)};r.current=window.requestAnimationFrame(s)})(t),()=>{r.current&&window.cancelAnimationFrame(r.current)})),n),o.useEffect((()=>{i.current=!0}),[])}}));
|
package/hooks/useAnimation.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react");function g(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,c.get?c:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=g(b),w=(t,r)=>{const e=o.useRef(0),c=o.useRef(!1),u=o.useRef(),d=n=>{const m=n.duration;let a,f;const p=e.current&&1-e.current;n.onStart&&n.onStart();const i=l=>{a||(a=l),f=l-a+1;const s=f/m+p;s<=1?(n.onUpdate&&n.onUpdate(s),u.current=window.requestAnimationFrame(i),e.current=s):(n.onEnd&&n.onEnd(1),e.current=0)};u.current=window.requestAnimationFrame(i)};o.useEffect(()=>(d(t),()=>{u.current&&window.cancelAnimationFrame(u.current)}),r),o.useEffect(()=>{c.current=!0},[])};exports.useAnimation=w;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react");function g(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,c.get?c:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=g(b),w=(t,r)=>{const e=o.useRef(0),c=o.useRef(!1),u=o.useRef(null),d=n=>{const m=n.duration;let a,f;const p=e.current&&1-e.current;n.onStart&&n.onStart();const i=l=>{a||(a=l),f=l-a+1;const s=f/m+p;s<=1?(n.onUpdate&&n.onUpdate(s),u.current=window.requestAnimationFrame(i),e.current=s):(n.onEnd&&n.onEnd(1),e.current=0)};u.current=window.requestAnimationFrame(i)};o.useEffect(()=>(d(t),()=>{u.current&&window.cancelAnimationFrame(u.current)}),r),o.useEffect(()=>{c.current=!0},[])};exports.useAnimation=w;
|
package/hooks/useAnimation.mjs
CHANGED
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as n from "react";
|
|
9
9
|
const p = (s, m) => {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const t = n.useRef(0), i = n.useRef(!1), r = n.useRef(null), d = (e) => {
|
|
11
|
+
const l = e.duration;
|
|
12
12
|
let o, u;
|
|
13
|
-
const
|
|
13
|
+
const w = t.current && 1 - t.current;
|
|
14
14
|
e.onStart && e.onStart();
|
|
15
15
|
const a = (f) => {
|
|
16
16
|
o || (o = f), u = f - o + 1;
|
|
17
|
-
const c = u /
|
|
18
|
-
c <= 1 ? (e.onUpdate && e.onUpdate(c), r.current = window.requestAnimationFrame(a),
|
|
17
|
+
const c = u / l + w;
|
|
18
|
+
c <= 1 ? (e.onUpdate && e.onUpdate(c), r.current = window.requestAnimationFrame(a), t.current = c) : (e.onEnd && e.onEnd(1), t.current = 0);
|
|
19
19
|
};
|
|
20
20
|
r.current = window.requestAnimationFrame(a);
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
n.useEffect(() => (d(s), () => {
|
|
23
23
|
r.current && window.cancelAnimationFrame(r.current);
|
|
24
|
-
}), m),
|
|
24
|
+
}), m), n.useEffect(() => {
|
|
25
25
|
i.current = !0;
|
|
26
26
|
}, []);
|
|
27
27
|
};
|
package/index.d.mts
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { AnimationsClassStructure } from '@progress/kendo-react-common';
|
|
9
9
|
import { default as default_2 } from 'prop-types';
|
|
10
|
-
import { JSX
|
|
10
|
+
import { JSX } from 'react/jsx-runtime';
|
|
11
11
|
import * as React_2 from 'react';
|
|
12
12
|
|
|
13
13
|
declare const Animation_2: {
|
|
14
|
-
(props: AnimationProps):
|
|
14
|
+
(props: AnimationProps): JSX.Element;
|
|
15
15
|
propTypes: {
|
|
16
16
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
17
17
|
childFactory: default_2.Requireable<any>;
|
|
@@ -241,7 +241,7 @@ export declare interface AnimationProps extends AnimationInterface {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
export declare const Expand: {
|
|
244
|
-
(props: ExpandProps):
|
|
244
|
+
(props: ExpandProps): JSX.Element;
|
|
245
245
|
propTypes: {
|
|
246
246
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
247
247
|
childFactory: default_2.Requireable<any>;
|
|
@@ -300,7 +300,7 @@ export declare interface ExpandProps extends AnimationInterface {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
export declare const Fade: {
|
|
303
|
-
(props: FadeProps):
|
|
303
|
+
(props: FadeProps): JSX.Element;
|
|
304
304
|
propTypes: {
|
|
305
305
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
306
306
|
childFactory: default_2.Requireable<any>;
|
|
@@ -345,7 +345,7 @@ export declare interface FadeProps extends AnimationInterface {
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
export declare const Push: {
|
|
348
|
-
(props: PushProps):
|
|
348
|
+
(props: PushProps): JSX.Element;
|
|
349
349
|
propTypes: {
|
|
350
350
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
351
351
|
childFactory: default_2.Requireable<any>;
|
|
@@ -411,7 +411,7 @@ export declare interface PushProps extends AnimationInterface {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
export declare const Reveal: {
|
|
414
|
-
(props: RevealProps):
|
|
414
|
+
(props: RevealProps): JSX.Element;
|
|
415
415
|
propTypes: {
|
|
416
416
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
417
417
|
childFactory: default_2.Requireable<any>;
|
|
@@ -475,7 +475,7 @@ export declare interface RevealProps extends AnimationInterface {
|
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
export declare const Slide: {
|
|
478
|
-
(props: SlideProps):
|
|
478
|
+
(props: SlideProps): JSX.Element;
|
|
479
479
|
propTypes: {
|
|
480
480
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
481
481
|
childFactory: default_2.Requireable<any>;
|
|
@@ -539,7 +539,7 @@ export declare interface SlideProps extends AnimationInterface {
|
|
|
539
539
|
export declare const useAnimation: (config: AnimationConfig, deps: any[]) => void;
|
|
540
540
|
|
|
541
541
|
export declare const Zoom: {
|
|
542
|
-
(props: ZoomProps):
|
|
542
|
+
(props: ZoomProps): JSX.Element;
|
|
543
543
|
propTypes: {
|
|
544
544
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
545
545
|
childFactory: default_2.Requireable<any>;
|
package/index.d.ts
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { AnimationsClassStructure } from '@progress/kendo-react-common';
|
|
9
9
|
import { default as default_2 } from 'prop-types';
|
|
10
|
-
import { JSX
|
|
10
|
+
import { JSX } from 'react/jsx-runtime';
|
|
11
11
|
import * as React_2 from 'react';
|
|
12
12
|
|
|
13
13
|
declare const Animation_2: {
|
|
14
|
-
(props: AnimationProps):
|
|
14
|
+
(props: AnimationProps): JSX.Element;
|
|
15
15
|
propTypes: {
|
|
16
16
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
17
17
|
childFactory: default_2.Requireable<any>;
|
|
@@ -241,7 +241,7 @@ export declare interface AnimationProps extends AnimationInterface {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
export declare const Expand: {
|
|
244
|
-
(props: ExpandProps):
|
|
244
|
+
(props: ExpandProps): JSX.Element;
|
|
245
245
|
propTypes: {
|
|
246
246
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
247
247
|
childFactory: default_2.Requireable<any>;
|
|
@@ -300,7 +300,7 @@ export declare interface ExpandProps extends AnimationInterface {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
export declare const Fade: {
|
|
303
|
-
(props: FadeProps):
|
|
303
|
+
(props: FadeProps): JSX.Element;
|
|
304
304
|
propTypes: {
|
|
305
305
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
306
306
|
childFactory: default_2.Requireable<any>;
|
|
@@ -345,7 +345,7 @@ export declare interface FadeProps extends AnimationInterface {
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
export declare const Push: {
|
|
348
|
-
(props: PushProps):
|
|
348
|
+
(props: PushProps): JSX.Element;
|
|
349
349
|
propTypes: {
|
|
350
350
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
351
351
|
childFactory: default_2.Requireable<any>;
|
|
@@ -411,7 +411,7 @@ export declare interface PushProps extends AnimationInterface {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
export declare const Reveal: {
|
|
414
|
-
(props: RevealProps):
|
|
414
|
+
(props: RevealProps): JSX.Element;
|
|
415
415
|
propTypes: {
|
|
416
416
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
417
417
|
childFactory: default_2.Requireable<any>;
|
|
@@ -475,7 +475,7 @@ export declare interface RevealProps extends AnimationInterface {
|
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
export declare const Slide: {
|
|
478
|
-
(props: SlideProps):
|
|
478
|
+
(props: SlideProps): JSX.Element;
|
|
479
479
|
propTypes: {
|
|
480
480
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
481
481
|
childFactory: default_2.Requireable<any>;
|
|
@@ -539,7 +539,7 @@ export declare interface SlideProps extends AnimationInterface {
|
|
|
539
539
|
export declare const useAnimation: (config: AnimationConfig, deps: any[]) => void;
|
|
540
540
|
|
|
541
541
|
export declare const Zoom: {
|
|
542
|
-
(props: ZoomProps):
|
|
542
|
+
(props: ZoomProps): JSX.Element;
|
|
543
543
|
propTypes: {
|
|
544
544
|
children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
|
|
545
545
|
childFactory: default_2.Requireable<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-animation",
|
|
3
|
-
"version": "10.2.0-develop.
|
|
3
|
+
"version": "10.2.0-develop.4",
|
|
4
4
|
"description": "React Animation component assists with animating HTML elements. KendoReact Animation package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.5.1",
|
|
29
|
-
"@progress/kendo-react-common": "10.2.0-develop.
|
|
29
|
+
"@progress/kendo-react-common": "10.2.0-develop.4",
|
|
30
30
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
31
31
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
32
32
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|