tdesign-react
Version:
TDesign Component for React
37 lines (33 loc) • 1.24 kB
JavaScript
/**
* tdesign v1.15.1
* (c) 2025 tdesign
* @license MIT
*/
import { useCallback } from 'react';
import useConfig from './useConfig.js';
import { EAnimationType } from '../config-provider/ConfigContext.js';
import '../_chunks/dep-cb0a3966.js';
import '../_chunks/dep-eca3a3de.js';
import 'lodash-es';
import '../locale/zh_CN.js';
import '../_chunks/dep-e29214cb.js';
import 'dayjs';
import '../_chunks/dep-3c9ab31a.js';
function useAnimation() {
var _useConfig = useConfig(),
animation = _useConfig.animation;
var expand = EAnimationType.expand,
ripple = EAnimationType.ripple,
fade = EAnimationType.fade;
var keepAnimation = useCallback(function (type) {
var _animation$exclude, _animation$include;
return animation && !((_animation$exclude = animation.exclude) !== null && _animation$exclude !== void 0 && _animation$exclude.includes(type)) && ((_animation$include = animation.include) === null || _animation$include === void 0 ? void 0 : _animation$include.includes(type));
}, [animation]);
return {
keepExpand: keepAnimation(expand),
keepRipple: keepAnimation(ripple),
keepFade: keepAnimation(fade)
};
}
export { useAnimation as default };
//# sourceMappingURL=useAnimation.js.map