chore: update ant-design dependencies and add new icon types

This commit is contained in:
Luiz Costa committed 2025-11-18 09:39:51 -03:00
1 parent 775e562fe9
commit 5c0094d74e
22648 files changed
+2140248 -29

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
import raf from "rc-util/es/raf";
import { easeInOutCubic } from './easings';
import getScroll, { isWindow } from './getScroll';
export default function scrollTo(y, options = {}) {
const {
getContainer = () => window,
callback,
duration = 450
} = options;
const container = getContainer();
const scrollTop = getScroll(container);
const startTime = Date.now();
const frameFunc = () => {
const timestamp = Date.now();
const time = timestamp - startTime;
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
if (isWindow(container)) {
container.scrollTo(window.pageXOffset, nextScrollTop);
} else if (container instanceof Document || container.constructor.name === 'HTMLDocument') {
container.documentElement.scrollTop = nextScrollTop;
} else {
container.scrollTop = nextScrollTop;
}
if (time < duration) {
raf(frameFunc);
} else if (typeof callback === 'function') {
callback();
}
};
raf(frameFunc);
}