tdesign-react
Version:
TDesign Component for React
61 lines (55 loc) • 2.26 kB
JavaScript
/**
* tdesign v1.13.2
* (c) 2025 tdesign
* @license MIT
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
var hooks_useConfig = require('./useConfig.js');
var configProvider_ConfigContext = require('../config-provider/ConfigContext.js');
require('../_chunks/dep-cc768e34.js');
require('../_chunks/dep-6d4d8660.js');
require('../_chunks/dep-3a869b87.js');
require('../_chunks/dep-ac58e1cc.js');
require('dayjs');
require('../_chunks/dep-7da96a57.js');
require('../_chunks/dep-07b911d8.js');
require('../_chunks/dep-4b02d669.js');
require('../_chunks/dep-f0379c5f.js');
require('../_chunks/dep-ddacd27a.js');
require('../_chunks/dep-028b759d.js');
require('../_chunks/dep-8a116183.js');
require('../_chunks/dep-4671b9bd.js');
require('../_chunks/dep-bed9d73e.js');
require('../_chunks/dep-780eda7b.js');
require('../_chunks/dep-47bdc05f.js');
require('../_chunks/dep-cab13149.js');
require('../_chunks/dep-a30819a4.js');
require('../_chunks/dep-6a7ba247.js');
require('../_chunks/dep-c87d9752.js');
require('../_chunks/dep-bd956a2d.js');
require('../_chunks/dep-0cdb3286.js');
require('../_chunks/dep-865c186c.js');
require('../_chunks/dep-f4e58639.js');
require('../_chunks/dep-781a2854.js');
require('../_chunks/dep-1ef213f8.js');
require('../_chunks/dep-e2c832a5.js');
function useAnimation() {
var _useConfig = hooks_useConfig["default"](),
animation = _useConfig.animation;
var expand = configProvider_ConfigContext.EAnimationType.expand,
ripple = configProvider_ConfigContext.EAnimationType.ripple,
fade = configProvider_ConfigContext.EAnimationType.fade;
var keepAnimation = React.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)
};
}
exports["default"] = useAnimation;
//# sourceMappingURL=useAnimation.js.map