rc-upload
Advanced tools
Comparing version 4.3.2 to 4.3.3
@@ -6,3 +6,3 @@ import React, { Component } from 'react'; | ||
action: string; | ||
data: object; | ||
data: Record<string, unknown>; | ||
parsedFile: RcFile; | ||
@@ -9,0 +9,0 @@ } |
@@ -12,3 +12,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _createSuper from "@babel/runtime/helpers/esm/createSuper"; | ||
var _excluded = ["component", "prefixCls", "className", "disabled", "id", "style", "multiple", "accept", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave", "capture"]; | ||
var _excluded = ["component", "prefixCls", "className", "disabled", "id", "style", "multiple", "accept", "capture", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave"]; | ||
import React, { Component } from 'react'; | ||
@@ -370,2 +370,3 @@ import classNames from 'classnames'; | ||
accept = _this$props4.accept, | ||
capture = _this$props4.capture, | ||
children = _this$props4.children, | ||
@@ -376,3 +377,2 @@ directory = _this$props4.directory, | ||
onMouseLeave = _this$props4.onMouseLeave, | ||
capture = _this$props4.capture, | ||
otherProps = _objectWithoutProperties(_this$props4, _excluded); | ||
@@ -379,0 +379,0 @@ |
@@ -13,3 +13,3 @@ import type * as React from 'react'; | ||
directory?: boolean; | ||
data?: object | ((file: RcFile | string | Blob) => object); | ||
data?: Record<string, unknown> | ((file: RcFile | string | Blob) => Record<string, unknown>); | ||
headers?: UploadRequestHeader; | ||
@@ -23,4 +23,4 @@ accept?: string; | ||
onStart?: (file: RcFile) => void; | ||
onError?: (error: Error, ret: object, file: RcFile) => void; | ||
onSuccess?: (response: object, file: RcFile, xhr: object) => void; | ||
onError?: (error: Error, ret: Record<string, unknown>, file: RcFile) => void; | ||
onSuccess?: (response: Record<string, unknown>, file: RcFile, xhr: XMLHttpRequest) => void; | ||
onProgress?: (event: UploadProgressEvent, file: RcFile) => void; | ||
@@ -37,4 +37,4 @@ beforeUpload?: (file: RcFile, FileList: RcFile[]) => BeforeUploadFileType | Promise<void | BeforeUploadFileType>; | ||
} | ||
export interface UploadProgressEvent extends ProgressEvent { | ||
percent: number; | ||
export interface UploadProgressEvent extends Partial<ProgressEvent> { | ||
percent?: number; | ||
} | ||
@@ -52,3 +52,3 @@ export declare type UploadRequestMethod = 'POST' | 'PUT' | 'PATCH' | 'post' | 'put' | 'patch'; | ||
onSuccess?: (body: T, xhr?: XMLHttpRequest) => void; | ||
data?: object; | ||
data?: Record<string, unknown>; | ||
filename?: string; | ||
@@ -55,0 +55,0 @@ file: Exclude<BeforeUploadFileType, File | boolean> | RcFile; |
@@ -54,3 +54,3 @@ function getError(option, xhr) { | ||
formData.append(key, option.data[key]); | ||
formData.append(key, value); | ||
}); | ||
@@ -57,0 +57,0 @@ } // eslint-disable-next-line no-undef |
@@ -6,3 +6,3 @@ import React, { Component } from 'react'; | ||
action: string; | ||
data: object; | ||
data: Record<string, unknown>; | ||
parsedFile: RcFile; | ||
@@ -9,0 +9,0 @@ } |
@@ -48,3 +48,3 @@ "use strict"; | ||
var _excluded = ["component", "prefixCls", "className", "disabled", "id", "style", "multiple", "accept", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave", "capture"]; | ||
var _excluded = ["component", "prefixCls", "className", "disabled", "id", "style", "multiple", "accept", "capture", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave"]; | ||
@@ -397,2 +397,3 @@ var AjaxUploader = /*#__PURE__*/function (_Component) { | ||
accept = _this$props4.accept, | ||
capture = _this$props4.capture, | ||
children = _this$props4.children, | ||
@@ -403,3 +404,2 @@ directory = _this$props4.directory, | ||
onMouseLeave = _this$props4.onMouseLeave, | ||
capture = _this$props4.capture, | ||
otherProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded); | ||
@@ -406,0 +406,0 @@ var cls = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, prefixCls, true), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames, className, className), _classNames)); // because input don't have directory/webkitdirectory type declaration |
@@ -13,3 +13,3 @@ import type * as React from 'react'; | ||
directory?: boolean; | ||
data?: object | ((file: RcFile | string | Blob) => object); | ||
data?: Record<string, unknown> | ((file: RcFile | string | Blob) => Record<string, unknown>); | ||
headers?: UploadRequestHeader; | ||
@@ -23,4 +23,4 @@ accept?: string; | ||
onStart?: (file: RcFile) => void; | ||
onError?: (error: Error, ret: object, file: RcFile) => void; | ||
onSuccess?: (response: object, file: RcFile, xhr: object) => void; | ||
onError?: (error: Error, ret: Record<string, unknown>, file: RcFile) => void; | ||
onSuccess?: (response: Record<string, unknown>, file: RcFile, xhr: XMLHttpRequest) => void; | ||
onProgress?: (event: UploadProgressEvent, file: RcFile) => void; | ||
@@ -37,4 +37,4 @@ beforeUpload?: (file: RcFile, FileList: RcFile[]) => BeforeUploadFileType | Promise<void | BeforeUploadFileType>; | ||
} | ||
export interface UploadProgressEvent extends ProgressEvent { | ||
percent: number; | ||
export interface UploadProgressEvent extends Partial<ProgressEvent> { | ||
percent?: number; | ||
} | ||
@@ -52,3 +52,3 @@ export declare type UploadRequestMethod = 'POST' | 'PUT' | 'PATCH' | 'post' | 'put' | 'patch'; | ||
onSuccess?: (body: T, xhr?: XMLHttpRequest) => void; | ||
data?: object; | ||
data?: Record<string, unknown>; | ||
filename?: string; | ||
@@ -55,0 +55,0 @@ file: Exclude<BeforeUploadFileType, File | boolean> | RcFile; |
@@ -61,3 +61,3 @@ "use strict"; | ||
formData.append(key, option.data[key]); | ||
formData.append(key, value); | ||
}); | ||
@@ -64,0 +64,0 @@ } // eslint-disable-next-line no-undef |
{ | ||
"name": "rc-upload", | ||
"version": "4.3.2", | ||
"version": "4.3.3", | ||
"description": "upload ui component for react", | ||
@@ -45,3 +45,3 @@ "keywords": [ | ||
"@umijs/fabric": "^2.0.0", | ||
"axios": "^0.20.0", | ||
"axios": "^0.23.0", | ||
"co-busboy": "^1.3.0", | ||
@@ -48,0 +48,0 @@ "coveralls": "^3.0.3", |
@@ -70,2 +70,3 @@ # rc-upload | ||
|accept | string | | input accept attribute | | ||
|capture | string | | input capture attribute | | ||
|multiple | boolean | false | only support ie10+| | ||
@@ -72,0 +73,0 @@ |onStart | function| | start upload file | |
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
63580
119