-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
5,748 additions
and
4,212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
src/ | ||
*.ts | ||
*.tsx | ||
*.map | ||
rollup.config.js | ||
.babelrc | ||
.eslintrc.js | ||
tests/ | ||
lib/VirtualizedListV2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry="https://registry.npmmirror.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
"@babel/preset-typescript" // 添加对 TypeScript 的支持 | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"files": { | ||
"main.css": "/react-virtualized-list/build/static/css/main.91612258.css", | ||
"main.js": "/react-virtualized-list/build/static/js/main.5cb797a1.js", | ||
"static/js/845.6038aacd.chunk.js": "/react-virtualized-list/build/static/js/845.6038aacd.chunk.js", | ||
"index.html": "/react-virtualized-list/build/index.html", | ||
"main.91612258.css.map": "/react-virtualized-list/build/static/css/main.91612258.css.map", | ||
"main.5cb797a1.js.map": "/react-virtualized-list/build/static/js/main.5cb797a1.js.map", | ||
"845.6038aacd.chunk.js.map": "/react-virtualized-list/build/static/js/845.6038aacd.chunk.js.map" | ||
"main.css": "/static/css/main.91612258.css", | ||
"main.js": "/static/js/main.eee57e94.js", | ||
"static/js/845.6038aacd.chunk.js": "/static/js/845.6038aacd.chunk.js", | ||
"index.html": "/index.html", | ||
"main.91612258.css.map": "/static/css/main.91612258.css.map", | ||
"main.eee57e94.js.map": "/static/js/main.eee57e94.js.map", | ||
"845.6038aacd.chunk.js.map": "/static/js/845.6038aacd.chunk.js.map" | ||
}, | ||
"entrypoints": [ | ||
"static/css/main.91612258.css", | ||
"static/js/main.5cb797a1.js" | ||
"static/js/main.eee57e94.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/react-virtualized-list/build/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/react-virtualized-list/build/logo192.png"/><link rel="manifest" href="/react-virtualized-list/build/manifest.json"/><title>React App</title><script defer="defer" src="/react-virtualized-list/build/static/js/main.5cb797a1.js"></script><link href="/react-virtualized-list/build/static/css/main.91612258.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.eee57e94.js"></script><link href="/static/css/main.91612258.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { CSSProperties } from 'react'; | ||
interface VirtualizedListProps<T> { | ||
listData: T[]; | ||
renderItem: (itemData: T, fetchData: any) => React.ReactNode; | ||
refreshOnVisible?: boolean; | ||
fetchItemData?: ((item: T) => Promise<any>) | null; | ||
containerHeight?: string; | ||
itemStyle?: CSSProperties; | ||
listClassName?: string | null; | ||
itemClassName?: string | null; | ||
observerOptions?: IntersectionObserverInit; | ||
onLoadMore?: () => Promise<void>; | ||
hasMore?: boolean; | ||
loader?: React.ReactNode; | ||
endMessage?: React.ReactNode; | ||
itemLoader?: React.ReactNode; | ||
emptyListMessage?: React.ReactNode; | ||
} | ||
declare const VirtualizedList: <T>({ listData, renderItem, refreshOnVisible, fetchItemData, containerHeight, itemStyle, listClassName, itemClassName, observerOptions, onLoadMore, hasMore, loader, endMessage, itemLoader, emptyListMessage, }: VirtualizedListProps<T>) => import("react/jsx-runtime").JSX.Element; | ||
export default VirtualizedList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ReactNode, ReactElement } from 'react'; | ||
interface VirtualizedListItemProps<T> { | ||
item: T; | ||
isVisible: boolean; | ||
refreshOnVisible: boolean; | ||
fetchItemData: ((item: T) => Promise<any>) | null; | ||
children: (item: T, data: any) => ReactNode; | ||
itemLoader: ReactNode; | ||
} | ||
declare const VirtualizedListItem: <T>({ item, isVisible, refreshOnVisible, fetchItemData, children, itemLoader }: VirtualizedListItemProps<T>) => ReactElement; | ||
export default VirtualizedListItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import VirtualizedList from './VirtualizedList'; | ||
import useIntersectionObserver from './useIntersectionObserver'; | ||
export { useIntersectionObserver }; | ||
export default VirtualizedList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
interface UseIntersectionObserverOptions extends IntersectionObserverInit { | ||
root?: Element | Document | null; | ||
rootMargin?: string; | ||
threshold?: number | number[]; | ||
} | ||
declare const useIntersectionObserver: (nodes: (Element | null)[], onVisibilityChange?: ((isVisible: boolean, entry: IntersectionObserverEntry) => void) | null | undefined, onEntryUpdate?: ((entry: IntersectionObserverEntry) => void) | null | undefined, options?: UseIntersectionObserverOptions) => { | ||
observe: (node: Element | null) => void; | ||
unobserve: (node: Element | null) => void; | ||
}; | ||
export default useIntersectionObserver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const debounce: <T extends (...args: any[]) => void>(func: T, delay: number) => (...args: Parameters<T>) => void; | ||
export { debounce }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.