{"versions":{"1.0.0":{"name":"@rc-component/upload","version":"1.0.0","description":"upload ui component for react","keywords":["react","react-component","react-upload","upload"],"homepage":"http://github.com/react-component/upload","bugs":{"url":"http://github.com/react-component/upload/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/react-component/upload.git"},"license":"MIT","main":"./lib/index","module":"./es/index","scripts":{"compile":"father build","coverage":"rc-test --coverage","docs:build":"dumi build","docs:deploy":"npm run docs:build && gh-pages -d dist","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","now-build":"npm run docs:build","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","postpublish":"npm run docs:deploy","start":"dumi dev","test":"rc-test"},"dependencies":{"@rc-component/util":"^1.3.0","classnames":"^2.2.5"},"devDependencies":{"@rc-component/father-plugin":"^2.0.2","@rc-component/np":"^1.0.4","@testing-library/jest-dom":"^6.1.5","@testing-library/react":"^16.2.0","@types/jest":"^30.0.0","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@umijs/fabric":"^4.0.1","axios":"^1.9.0","co-busboy":"^2.0.2","coveralls":"^3.0.3","cross-env":"^7.0.0","dumi":"^2.1.0","eslint":"^8.0.0","father":"^4.0.0","fs-extra":"^11.2.0","gh-pages":"^6.1.1","raf":"^3.4.0","rc-test":"^7.0.13","react":"^18.0.0","react-dom":"^18.0.0","regenerator-runtime":"^0.14.1","sinon":"^9.0.2","typescript":"^5.3.3","vinyl-fs":"^4.0.0"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_id":"@rc-component/upload@1.0.0","gitHead":"2e160a2b4c24d954e95dff302519528ca408823d","types":"./lib/index.d.ts","_nodeVersion":"22.15.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-jRnGElnVycACSAm9DvDrOJuC1PefhwjkZH60DFUz836dJF4kfrOVhqTg86kD3gemcRRGIbxO8RA5tvsTk+q2rA==","shasum":"8de5b9bef62f130cca764486cc443f88296b8717","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@rc-component/upload/-/upload-1.0.0.tgz","fileCount":35,"unpackedSize":57989,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2nLRmaPoHaP4bPfbCX0Ahq7nguvP6cK0lrQVqtd3ZuwIhAIELrBgP1jt16nTaZMJWiUY1a3Ax6MDCdPEbjX1mBLNj"}],"size":11942},"_npmUser":{"name":"anonymous","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"smith3816@gmail.com"},{"name":"anonymous","email":"afc163@gmail.com"},{"name":"anonymous","email":"1075746765@qq.com"},{"name":"anonymous","email":"scdzwyxst@gmail.com"},{"name":"anonymous","email":"wasd2144@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/upload_1.0.0_1759047678216_0.4514754494547575"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-28T08:21:18.405Z","publish_time":1759047678405,"_source_registry_name":"default","contributors":[]},"1.1.0":{"name":"@rc-component/upload","version":"1.1.0","description":"upload ui component for react","keywords":["react","react-component","react-upload","upload"],"homepage":"http://github.com/react-component/upload","bugs":{"url":"http://github.com/react-component/upload/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/react-component/upload.git"},"license":"MIT","main":"./lib/index","module":"./es/index","scripts":{"compile":"father build","coverage":"rc-test --coverage","docs:build":"dumi build","docs:deploy":"npm run docs:build && gh-pages -d dist","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","now-build":"npm run docs:build","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","postpublish":"npm run docs:deploy","start":"dumi dev","test":"rc-test"},"dependencies":{"@rc-component/util":"^1.3.0","clsx":"^2.1.1"},"devDependencies":{"@rc-component/father-plugin":"^2.0.2","@rc-component/np":"^1.0.4","@testing-library/jest-dom":"^6.1.5","@testing-library/react":"^16.2.0","@types/jest":"^30.0.0","@types/node":"^24.5.2","@types/react":"^19.2.2","@types/react-dom":"^19.2.2","@umijs/fabric":"^4.0.1","axios":"^1.9.0","co-busboy":"^2.0.2","coveralls":"^3.0.3","cross-env":"^10.1.0","dumi":"^2.1.0","eslint":"^8.0.0","father":"^4.0.0","fs-extra":"^11.2.0","gh-pages":"^6.1.1","rc-test":"^7.0.13","react":"^18.0.0","react-dom":"^18.0.0","regenerator-runtime":"^0.14.1","sinon":"^9.0.2","typescript":"^5.3.3","vinyl-fs":"^4.0.0"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_id":"@rc-component/upload@1.1.0","gitHead":"705141ce4f2c3d1c506fd0cef9531ae48d8dfc5d","types":"./lib/index.d.ts","_nodeVersion":"22.15.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-LIBV90mAnUE6VK5N4QvForoxZc4XqEYZimcp7fk+lkE4XwHHyJWxpIXQQwMU8hJM+YwBbsoZkGksL1sISWHQxw==","shasum":"cb634587ffdf8a8a4a26a279fac06989fb47f593","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@rc-component/upload/-/upload-1.1.0.tgz","fileCount":35,"unpackedSize":58992,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFIk5CNIdrTuCtQaJOFWw1lTSsuZSD5p4GebL/2JqJ2xAiEAnBUO079SmHbFzew8Emm5Ijhk8i4TFTTl93rsQ2WTTJU="}],"size":12074},"_npmUser":{"name":"anonymous","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"smith3816@gmail.com"},{"name":"anonymous","email":"afc163@gmail.com"},{"name":"anonymous","email":"1075746765@qq.com"},{"name":"anonymous","email":"scdzwyxst@gmail.com"},{"name":"anonymous","email":"wasd2144@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/upload_1.1.0_1761892707120_0.11129739285173335"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-31T06:38:27.287Z","publish_time":1761892707287,"_source_registry_name":"default","contributors":[]},"1.1.1":{"name":"@rc-component/upload","version":"1.1.1","description":"upload ui component for react","keywords":["react","react-component","react-upload","upload"],"homepage":"http://github.com/react-component/upload","bugs":{"url":"http://github.com/react-component/upload/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/react-component/upload.git"},"license":"MIT","main":"./lib/index","module":"./es/index","scripts":{"compile":"father build","coverage":"rc-test --coverage","docs:build":"dumi build","docs:deploy":"npm run docs:build && gh-pages -d dist","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","now-build":"npm run docs:build","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","postpublish":"npm run docs:deploy","start":"dumi dev","test":"rc-test"},"dependencies":{"@rc-component/util":"^1.11.1","clsx":"^2.1.1"},"devDependencies":{"@rc-component/father-plugin":"^2.2.0","@rc-component/np":"^1.0.4","@testing-library/jest-dom":"^6.1.5","@testing-library/react":"^16.2.0","@types/jest":"^30.0.0","@types/node":"^25.0.1","@types/react":"^19.2.2","@types/react-dom":"^19.2.2","@umijs/fabric":"^4.0.1","axios":"^1.9.0","dumi":"^2.1.0","eslint":"^8.0.0","father":"^4.0.0","gh-pages":"^6.1.1","rc-test":"^7.0.13","react":"^18.0.0","react-dom":"^18.0.0","regenerator-runtime":"^0.14.1","sinon":"^9.0.2","typescript":"^5.3.3"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"gitHead":"d53036dbfab8b2efca4942a7f8c76d15fbdcafc5","types":"./lib/index.d.ts","_id":"@rc-component/upload@1.1.1","_nodeVersion":"22.15.1","_npmVersion":"11.7.0","dist":{"integrity":"sha512-GvYWSKeaJTOxxC5p6+nOSadzfvXA1h8C/iHFPFZX+szH3JUXrvs+DLiW8YUTBgvMh8m63mJeHrlYlJzAlg+pDA==","shasum":"90d16edcdaeb104ffa9111fd0b428061de7c21ac","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@rc-component/upload/-/upload-1.1.1.tgz","fileCount":35,"unpackedSize":58977,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCBLsUgqRwjLeyKSbbKls20ng6hGeOUqQ9xoW5nTr0qNwIgELbEzizTisLkAeljQBzsQIpLzbqyfWyBy8tAnfexkw8="}],"size":12009},"_npmUser":{"name":"anonymous","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"smith3816@gmail.com"},{"name":"anonymous","email":"afc163@gmail.com"},{"name":"anonymous","email":"1075746765@qq.com"},{"name":"anonymous","email":"scdzwyxst@gmail.com"},{"name":"anonymous","email":"wasd2144@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/upload_1.1.1_1779780998671_0.46266048295966256"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-05-26T07:36:38.804Z","publish_time":1779780998804,"_source_registry_name":"default","contributors":[]},"1.2.0":{"_id":"@rc-component/upload@1.2.0","bugs":{"url":"https://github.com/react-component/upload/issues"},"dist":{"shasum":"26290a49f84d5c55f37032ecba4971a828f1df1a","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@rc-component/upload/-/upload-1.2.0.tgz","fileCount":36,"integrity":"sha512-Mvlk4RGi4GKi4mdkDvJRd+W1f1AexRMwVMmCNFqrQvp1EHPw3xgwKSX3rak1wLzY/iKbnhBc5XpeAEPOyAUTAQ==","signatures":[{"sig":"MEYCIQDi5AZfv9hVb2OwWAAYiH64eXrtTY95KkKoqw5j68hBxgIhAJMBPatawt+AN8Vb0/TsB+x1/dSNthH9YmVWNBBAbd5+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBO6BPiEUmKsWNXX7cmcCr0EUdacA5pe/UPl+fSWXLeTAiBDE8ZiprUo0aSHdbOdPlTuo3plJr7a3+9UWGxYvPLbpw=="}],"unpackedSize":66396,"size":13886},"main":"./lib/index","name":"@rc-component/upload","types":"./es/index.d.ts","module":"./es/index","gitHead":"c927881d6b2e9a8fcb91f81e124303e733532ada","license":"MIT","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"rc-test","build":"npm run compile && npm run docs:build","start":"dumi dev","deploy":"npm run gh-pages","compile":"father build","prepare":"husky","coverage":"rc-test --coverage","gh-pages":"npm run compile && cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy","prettier":"prettier --write --ignore-unknown .","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","prepublishOnly":"npm run compile && rc-np"},"version":"1.2.0","_npmUser":{"name":"anonymous","email":"smith3816@gmail.com"},"homepage":"https://react-component.github.io/upload","keywords":["react","react-component","react-upload","upload"],"repository":{"url":"git+https://github.com/react-component/upload.git","type":"git"},"_npmVersion":"11.17.0","description":"Upload UI component for React","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"maintainers":[{"name":"anonymous","email":"smith3816@gmail.com"},{"name":"anonymous","email":"afc163@gmail.com"},{"name":"anonymous","email":"1075746765@qq.com"},{"name":"anonymous","email":"scdzwyxst@gmail.com"},{"name":"anonymous","email":"wasd2144@hotmail.com"}],"_nodeVersion":"24.19.0","dependencies":{"clsx":"^2.1.1","@rc-component/util":"^1.11.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.38","axios":"^1.9.0","husky":"^9.1.7","react":"^19.2.7","sinon":"^9.0.2","eslint":"^10.6.0","father":"^4.6.24","globals":"^17.7.0","rc-test":"^7.1.3","gh-pages":"^6.3.0","prettier":"^3.9.4","cross-env":"^10.1.0","react-dom":"^19.2.7","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^26.0.1","lint-staged":"^17.0.8","@types/react":"^19.2.17","@eslint/compat":"^2.1.0","@rc-component/np":"^1.0.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.62.1","eslint-plugin-jest":"^29.15.4","eslint-plugin-react":"^7.37.5","regenerator-runtime":"^0.14.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","eslint-config-prettier":"^10.1.8","@testing-library/jest-dom":"^6.9.1","eslint-plugin-react-hooks":"^7.1.1","@rc-component/father-plugin":"^2.2.0"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/upload_1.2.0_1789097808422_0.7359335332923986"},"_cnpmcore_publish_time":"2026-09-11T03:36:48.510Z","publish_time":1789097808510,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.2.0"},"name":"@rc-component/upload","time":{"created":"2025-09-28T08:21:25.642Z","modified":"2026-09-11T03:36:59.383Z","1.0.0":"2025-09-28T08:21:18.405Z","1.1.0":"2025-10-31T06:38:27.287Z","1.1.1":"2026-05-26T07:36:38.804Z","1.2.0":"2026-09-11T03:36:48.510Z"},"readme":"<div align=\"center\">\n  <h1>@rc-component/upload</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> Part of the Ant Design ecosystem.</sub></p>\n  <p>📤 Low-level React upload primitive for Ajax, drag, paste, directory, and custom requests.</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/upload\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/upload.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/upload\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/upload.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/upload/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/upload/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/upload\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/upload/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/upload\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/upload?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\">English | <a href=\"./README.zh-CN.md\">简体中文</a></p>\n\n## Highlights\n\n- Supports Ajax uploads with progress, headers, credentials, and custom request overrides.\n- Supports directory, drag, paste, async action, and before-upload flows.\n- Exposes `abort(file)` through the component instance for active requests.\n- Provides semantic `classNames` and `styles` slots for the hidden input.\n\n## Install\n\n```bash\nnpm install @rc-component/upload\n```\n\n## Usage\n\n```tsx pure\nimport Upload from '@rc-component/upload';\n\nexport default () => (\n  <Upload\n    action=\"/upload\"\n    onStart={file => {\n      console.log('start', file.name);\n    }}\n    onSuccess={(response, file) => {\n      console.log('success', file.name, response);\n    }}\n  >\n    <button type=\"button\">Upload</button>\n  </Upload>\n);\n```\n\nOnline preview: https://upload.react-component.vercel.app/\n\n## Examples\n\nRun the local dumi site:\n\n```bash\nnpm install\nnpm start\n```\n\nThen open `http://localhost:8000`.\n\n## API\n\n### Upload\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `accept` | string \\| AcceptConfig | - | Input accept config. |\n| `action` | string \\| `(file) => string \\| PromiseLike<string>` | - | Upload URL or async resolver. |\n| `beforeUpload` | `(file, fileList) => BeforeUploadFileType \\| Promise<void \\| BeforeUploadFileType> \\| void` | - | Validate or transform before upload. Return false to stop upload. |\n| `className` | string | - | Root class name. |\n| `classNames` | `{ input?: string }` | - | Semantic class names. |\n| `component` | React.ComponentType<any> \\| string | `'span'` | Root component. |\n| `customRequest` | CustomUploadRequestOption | - | Override default request behavior. |\n| `data` | object \\| `(file) => object` | `{}` | Extra upload data. |\n| `directory` | boolean | false | Enable directory upload. |\n| `disabled` | boolean | false | Disable upload trigger. |\n| `hasControlInside` | boolean | false | Whether child already contains a control element. |\n| `headers` | Record<string, string> | `{}` | Request headers. |\n| `id` | string | - | Input id. |\n| `method` | `'POST' \\| 'PUT' \\| 'PATCH' \\| 'post' \\| 'put' \\| 'patch'` | `'post'` | Request method. |\n| `multiple` | boolean | false | Allow multiple file selection. |\n| `name` | string | `'file'` | File field name. |\n| `onBatchStart` | `(fileList) => void` | - | Called when a batch starts. |\n| `onError` | `(error, response, file) => void` | - | Upload error callback. |\n| `onProgress` | `(event, file) => void` | - | Upload progress callback. |\n| `onStart` | `(file) => void` | - | Upload start callback. |\n| `onSuccess` | `(response, file, xhr) => void` | - | Upload success callback. |\n| `openFileDialogOnClick` | boolean | true | Open file dialog when root is clicked. |\n| `pastable` | boolean | false | Enable paste upload. |\n| `prefixCls` | string | `'rc-upload'` | Prefix class name. |\n| `style` | React.CSSProperties | - | Root style. |\n| `styles` | `{ input?: React.CSSProperties }` | - | Semantic styles. |\n| `withCredentials` | boolean | false | Send credentials with Ajax upload. |\n\n### Methods\n\n| Name    | Type                     | Description                          |\n| ------- | ------------------------ | ------------------------------------ |\n| `abort` | `(file: RcFile) => void` | Abort an active upload.              |\n| `retry` | `(file: RcFile) => void` | Retry an upload for a specific file. |\n\n## Development\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run tsc\nnpm run compile\nnpm run build\n```\n\nThe dumi site runs at `http://localhost:8000` by default.\n\n## Release\n\n```bash\nnpm run prepublishOnly\n```\n\nThe release flow is handled by `@rc-component/np` through the `rc-np` command after the package build.\n\n## License\n\n@rc-component/upload is released under the [MIT](./LICENSE) license.","users":{}}