{"name":"@rc-component/virtual-list","version":"1.1.0","keywords":["react","react-component","virtual-list"],"author":{"name":"smith3816@gmail.com"},"license":"MIT","_id":"@rc-component/virtual-list@1.1.0","maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"peachscript","email":"scdzwyxst@gmail.com"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"}],"homepage":"https://github.com/react-component/virtual-list","bugs":{"url":"https://github.com/react-component/virtual-list/issues"},"dist":{"shasum":"94cdab75776a44a47cf1d4905c2828cf1cc62720","tarball":"http://registry-npm.ywwl.com/@rc-component/virtual-list/download/@rc-component/virtual-list-1.1.0.tgz","fileCount":87,"integrity":"sha512-fSzVg8xFDCK+xKJJ9lljBpaGDmur4REZwXHJjsNFRi4UbfOXuH/FSbGC2oliCE5krFqM3lSZqB4Ly4vc3xQHOQ==","signatures":[{"sig":"MEUCIFMt9UsH/ks6j4UWSdah9mtSOgwPsTHSDeCoai4Hl6rJAiEAtt44F7v9B8A1gPAUMFWpUmT+YcDotm9NEZyneWCmVTE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":130416,"size":22442,"noattachment":false,"key":"/@rc-component/virtual-list/-/@rc-component/virtual-list-1.1.0.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"8d2ead3e8a2f1b16a5b59fcfd9bdb9104be7aecc","scripts":{"lint":"eslint src/ --ext .tsx,.ts","test":"rc-test","build":"dumi build","start":"dumi dev","compile":"father build","now-build":"npm run build","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+https://github.com/react-component/virtual-list.git","type":"git"},"_npmVersion":"11.7.0","description":"React Virtual List Component","directories":{},"_nodeVersion":"22.15.1","dependencies":{"clsx":"^2.1.1","@babel/runtime":"^7.20.0","@rc-component/util":"^1.4.0","@rc-component/resize-observer":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.2.17","glob":"^7.1.6","react":"16.14.0","enzyme":"^3.1.0","eslint":"^8.56.0","father":"^4.4.0","cheerio":"1.0.0-rc.12","rc-test":"^7.0.15","react-dom":"16.14.0","rc-animate":"^2.9.1","typescript":"^5.0.0","@types/jest":"^30.0.0","@types/node":"^24.10.1","@types/react":"^18.0.8","@types/enzyme":"^3.10.5","@types/warning":"^3.0.0","@rc-component/np":"^1.0.4","@types/react-dom":"^18.0.3","eslint-plugin-unicorn":"^55.0.0","@testing-library/react":"^12.1.5","enzyme-adapter-react-16":"^1.15.6","@testing-library/jest-dom":"^5.17.0","@rc-component/father-plugin":"^2.1.3"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_npmOperationalInternal":{"tmp":"tmp/virtual-list_1.1.0_1779093933308_0.8605926139413687","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/virtual-list</h1>\n  <p><sub><a href=\"https://ant.design\"><img alt=\"Ant Design\" height=\"14\" src=\"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg\" style=\"vertical-align: -0.125em;\" /></a> Ant Design 生态的一部分。</sub></p>\n  <p>📜 React 虚拟列表组件，用于高性能渲染长列表。</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/virtual-list\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/virtual-list.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/virtual-list\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/virtual-list.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/virtual-list/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/virtual-list/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/virtual-list\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/virtual-list/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/virtual-list\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/virtual-list?style=flat-square\"></a>\n    <a href=\"https://github.com/umijs/dumi\"><img alt=\"dumi\" src=\"https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\"></a>\n  </p>\n</div>\n\n<p align=\"center\"><a href=\"./README.md\">English</a> | 简体中文</p>\n\n## 特性\n\n- 面向 React 构建，并由 rc-component 团队维护。\n- 被 Ant Design 使用和其他 React 组件库使用。\n- 提供 TypeScript 类型声明，同时输出 ES module 和 CommonJS 产物。\n- 示例、测试和预览构建与包源码保持一致。\n\n## 安装\n\n```bash\nnpm install @rc-component/virtual-list\n```\n\n## 使用\n\n```tsx\nimport List from '@rc-component/virtual-list';\n\nconst data = Array.from({ length: 1000 }).map((_, index) => ({\n  id: index,\n  label: `Item ${index}`,\n}));\n\nexport default () => (\n  <List data={data} height={240} itemHeight={32} itemKey=\"id\">\n    {(item) => <div>{item.label}</div>}\n  </List>\n);\n```\n\n## 示例\n\n运行本地 dumi 站点：\n\n```bash\nnpm install\nnpm start\n```\n\n然后打开 `http://localhost:8000`。\n\n## API\n\n### List\n\n| 属性       | 说明                                                               | 类型                                   | 默认值  |\n| ---------- | ------------------------------------------------------------------ | -------------------------------------- | ------- |\n| children   | 每一项的渲染函数。第三个参数包含旧浏览器兼容路径使用的测量 props。 | `(item, index, props) => ReactElement` | -       |\n| component  | 自定义列表容器元素。                                               | `string` \\| `ComponentType`            | `div`   |\n| data       | 虚拟列表渲染的数据项。                                             | `T[]`                                  | -       |\n| disabled   | 禁用滚动位置检查，通常用于配合动画。                               | `boolean`                              | `false` |\n| fullHeight | holder 是否保持完整高度。                                          | `boolean`                              | `true`  |\n| height     | 可视列表高度。                                                     | `number`                               | -       |\n| itemHeight | 用于计算虚拟范围的最小项高度。                                     | `number`                               | -       |\n| itemKey    | 数据项 key 字段或 key 获取函数。                                   | `string` \\| `(item) => React.Key`      | -       |\n| onScroll   | 列表滚动时调用。                                                   | `React.UIEventHandler<HTMLElement>`    | -       |\n| styles     | 自定义滚动条部位样式。                                             | `object`                               | -       |\n| virtual    | 启用虚拟渲染。                                                     | `boolean`                              | `true`  |\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run build\n```\n\ndumi 站点默认运行在 `http://localhost:8000`。\n\n## 发布\n\n```bash\nnpm run prepublishOnly\n```\n\n包构建完成后，发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。\n\n## 许可证\n\n@rc-component/virtual-list 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1779093933433,"_cnpm_publish_time":1779093933433,"dist-tags":{"latest":"1.6.0"}}