rc-upload
Advanced tools
Comparing version 4.7.0 to 4.8.0
@@ -14,3 +14,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
var _excluded = ["component", "prefixCls", "className", "classNames", "disabled", "id", "style", "styles", "multiple", "accept", "capture", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave", "hasControlInside"]; | ||
var _excluded = ["component", "prefixCls", "className", "classNames", "disabled", "id", "name", "style", "styles", "multiple", "accept", "capture", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave", "hasControlInside"]; | ||
/* eslint react/no-is-mounted:0,react/sort-comp:0,react/prop-types:0 */ | ||
@@ -341,2 +341,3 @@ import clsx from 'classnames'; | ||
id = _this$props3.id, | ||
name = _this$props3.name, | ||
style = _this$props3.style, | ||
@@ -379,2 +380,3 @@ _this$props3$styles = _this$props3.styles, | ||
id: id, | ||
name: name, | ||
disabled: disabled, | ||
@@ -381,0 +383,0 @@ type: "file", |
@@ -26,3 +26,5 @@ import type * as React from 'react'; | ||
beforeUpload?: (file: RcFile, FileList: RcFile[]) => BeforeUploadFileType | Promise<void | BeforeUploadFileType> | void; | ||
customRequest?: (option: UploadRequestOption) => void; | ||
customRequest?: (option: UploadRequestOption) => void | { | ||
abort: () => void; | ||
}; | ||
withCredentials?: boolean; | ||
@@ -48,2 +50,3 @@ openFileDialogOnClick?: boolean; | ||
export type UploadRequestHeader = Record<string, string>; | ||
export type UploadRequestFile = Exclude<BeforeUploadFileType, File | boolean> | RcFile; | ||
export interface UploadRequestError extends Error { | ||
@@ -55,8 +58,8 @@ status?: number; | ||
export interface UploadRequestOption<T = any> { | ||
onProgress?: (event: UploadProgressEvent) => void; | ||
onProgress?: (event: UploadProgressEvent, file?: UploadRequestFile) => void; | ||
onError?: (event: UploadRequestError | ProgressEvent, body?: T) => void; | ||
onSuccess?: (body: T, xhr?: XMLHttpRequest) => void; | ||
onSuccess?: (body: T, fileOrXhr?: UploadRequestFile | XMLHttpRequest) => void; | ||
data?: Record<string, unknown>; | ||
filename?: string; | ||
file: Exclude<BeforeUploadFileType, File | boolean> | RcFile; | ||
file: UploadRequestFile; | ||
withCredentials?: boolean; | ||
@@ -63,0 +66,0 @@ action: string; |
@@ -11,3 +11,2 @@ import React, { Component } from 'react'; | ||
headers: {}; | ||
name: string; | ||
multipart: boolean; | ||
@@ -14,0 +13,0 @@ onStart: typeof empty; |
@@ -48,3 +48,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
headers: {}, | ||
name: 'file', | ||
multipart: false, | ||
@@ -51,0 +50,0 @@ onStart: empty, |
@@ -29,3 +29,3 @@ "use strict"; | ||
var _uid = _interopRequireDefault(require("./uid")); | ||
var _excluded = ["component", "prefixCls", "className", "classNames", "disabled", "id", "style", "styles", "multiple", "accept", "capture", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave", "hasControlInside"]; | ||
var _excluded = ["component", "prefixCls", "className", "classNames", "disabled", "id", "name", "style", "styles", "multiple", "accept", "capture", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave", "hasControlInside"]; | ||
/* eslint react/no-is-mounted:0,react/sort-comp:0,react/prop-types:0 */ | ||
@@ -349,2 +349,3 @@ var AjaxUploader = /*#__PURE__*/function (_Component) { | ||
id = _this$props3.id, | ||
name = _this$props3.name, | ||
style = _this$props3.style, | ||
@@ -387,2 +388,3 @@ _this$props3$styles = _this$props3.styles, | ||
id: id, | ||
name: name, | ||
disabled: disabled, | ||
@@ -389,0 +391,0 @@ type: "file", |
@@ -26,3 +26,5 @@ import type * as React from 'react'; | ||
beforeUpload?: (file: RcFile, FileList: RcFile[]) => BeforeUploadFileType | Promise<void | BeforeUploadFileType> | void; | ||
customRequest?: (option: UploadRequestOption) => void; | ||
customRequest?: (option: UploadRequestOption) => void | { | ||
abort: () => void; | ||
}; | ||
withCredentials?: boolean; | ||
@@ -48,2 +50,3 @@ openFileDialogOnClick?: boolean; | ||
export type UploadRequestHeader = Record<string, string>; | ||
export type UploadRequestFile = Exclude<BeforeUploadFileType, File | boolean> | RcFile; | ||
export interface UploadRequestError extends Error { | ||
@@ -55,8 +58,8 @@ status?: number; | ||
export interface UploadRequestOption<T = any> { | ||
onProgress?: (event: UploadProgressEvent) => void; | ||
onProgress?: (event: UploadProgressEvent, file?: UploadRequestFile) => void; | ||
onError?: (event: UploadRequestError | ProgressEvent, body?: T) => void; | ||
onSuccess?: (body: T, xhr?: XMLHttpRequest) => void; | ||
onSuccess?: (body: T, fileOrXhr?: UploadRequestFile | XMLHttpRequest) => void; | ||
data?: Record<string, unknown>; | ||
filename?: string; | ||
file: Exclude<BeforeUploadFileType, File | boolean> | RcFile; | ||
file: UploadRequestFile; | ||
withCredentials?: boolean; | ||
@@ -63,0 +66,0 @@ action: string; |
@@ -11,3 +11,2 @@ import React, { Component } from 'react'; | ||
headers: {}; | ||
name: string; | ||
multipart: boolean; | ||
@@ -14,0 +13,0 @@ onStart: typeof empty; |
@@ -57,3 +57,2 @@ "use strict"; | ||
headers: {}, | ||
name: 'file', | ||
multipart: false, | ||
@@ -60,0 +59,0 @@ onStart: empty, |
{ | ||
"name": "rc-upload", | ||
"version": "4.7.0", | ||
"version": "4.8.0", | ||
"description": "upload ui component for react", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"now-build": "npm run docs:build", | ||
"prepublishOnly": "npm run compile", | ||
"prepublishOnly": "npm run compile && np --yolo --no-publish", | ||
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", | ||
@@ -36,0 +36,0 @@ "postpublish": "npm run docs:deploy", |
@@ -5,12 +5,17 @@ # rc-upload | ||
[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Test coverage][coveralls-image]][coveralls-url] [![Dependencies][david-image]][david-url] [![DevDependencies][david-dev-image]][david-dev-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url] | ||
[![NPM version][npm-image]][npm-url] | ||
[![npm download][download-image]][download-url] | ||
[![build status][github-actions-image]][github-actions-url] | ||
[![Codecov][codecov-image]][codecov-url] | ||
[![bundle size][bundlephobia-image]][bundlephobia-url] | ||
[![dumi][dumi-image]][dumi-url] | ||
[npm-image]: https://img.shields.io/npm/v/rc-upload.svg?style=flat-square | ||
[npm-url]: http://npmjs.org/package/rc-upload | ||
[npm-image]: http://img.shields.io/npm/v/rc-select.svg?style=flat-square | ||
[npm-url]: http://npmjs.org/package/rc-select | ||
[travis-image]: https://img.shields.io/travis/react-component/upload/master?style=flat-square | ||
[travis-url]: https://travis-ci.com/react-component/upload | ||
[github-actions-image]: https://github.com/react-component/upload/workflows/CI/badge.svg | ||
[github-actions-url]: https://github.com/react-component/upload/actions | ||
[circleci-image]: https://img.shields.io/circleci/react-component/upload/master?style=flat-square | ||
[circleci-url]: https://circleci.com/gh/react-component/upload | ||
[coveralls-image]: https://img.shields.io/coveralls/react-component/upload.svg?style=flat-square | ||
[coveralls-url]: https://coveralls.io/r/react-component/upload?branch=master | ||
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/upload/master.svg?style=flat-square | ||
[codecov-url]: https://app.codecov.io/gh/react-component/upload | ||
[david-url]: https://david-dm.org/react-component/upload | ||
@@ -20,6 +25,8 @@ [david-image]: https://david-dm.org/react-component/upload/status.svg?style=flat-square | ||
[david-dev-image]: https://david-dm.org/react-component/upload/dev-status.svg?style=flat-square | ||
[download-image]: https://img.shields.io/npm/dm/rc-upload.svg?style=flat-square | ||
[download-url]: https://npmjs.org/package/rc-upload | ||
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-upload | ||
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-upload | ||
[download-image]: https://img.shields.io/npm/dm/rc-select.svg?style=flat-square | ||
[download-url]: https://npmjs.org/package/rc-select | ||
[bundlephobia-url]: https://bundlephobia.com/package/rc-select | ||
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-select | ||
[dumi-url]: https://github.com/umijs/dumi | ||
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square | ||
@@ -26,0 +33,0 @@ ## Development |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79898
1885
126