Skip to content

chore: use dumi #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# top-most EditorConfig file
# http://editorconfig.org
root = true

# Unix-style newlines with a newline ending every file
[*.{js,css}]
end_of_line = lf
insert_final_newline = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ module.exports = {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-inferrable-types": 0,
"@typescript-eslint/no-unused-vars": 0,
"react/no-find-dom-node": 0,
"react/require-default-props": 0,
"no-confusing-arrow": 0,
"import/no-named-as-default-member": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/label-has-associated-control": 0,
"import/no-named-as-default": 0,
"import/no-extraneous-dependencies": 0,
"no-underscore-dangle": 0,
},
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ tmp/
.history
.storybook
.doc

# umi
.umi
.umi-production
.umi-test
.env.local
32 changes: 32 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

const name = 'rc-upload';

export default defineConfig({
title: name,
favicon:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
logo:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
outputPath: '.doc',
exportStatic: {},
styles: [
`a img + svg {
display: none;
}`
],
scripts: [{
content: `
(function () {
var timer = setInterval(function() {
try {
var menuList = document.getElementsByClassName('__dumi-default-menu-list');
menuList[0].childNodes[0].childNodes[0].innerText = '${name}';
clearInterval(timer);
} catch (e) {}
}, 200)
})();
`
}]
});
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016-present react-component

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# rc-upload
---

React Upload

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-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] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][travis-image]][travis-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-image]: https://img.shields.io/npm/v/rc-upload.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-upload
Expand Down Expand Up @@ -37,10 +30,9 @@ npm start

## Example

http://localhost:8020/examples/

online example: https://react-component.github.io/upload/
http://localhost:8000/

online example: https://upload.react-component.vercel.app/

## Feature

Expand Down
89 changes: 46 additions & 43 deletions HISTORY.md → docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,176 +1,179 @@
# History
----
# Changelog

### 3.3.0
## 3.3.1

- refatcor: change timeout to promise. [#277](https://github.com/react-component/upload/pull/277)

## 3.3.0

`2020-08-31`

- chore: use father. [#268](https://github.com/react-component/upload/pull/268)

### 3.2.0
## 3.2.0

- support `onClick` `onMouseEnter` `onMouseLeave`.

### 3.1.0
## 3.1.0

- `data` could return Promise.

### 3.0.0
## 3.0.0

- Drop support of IE8/9.

### 2.9.0
## 2.9.0

- Support `method`. #197

### 2.8.0
## 2.8.0

- `multiple` will works on drag upload.

### 2.7.0
## 2.7.0

- Support `transformFile` props to handle file before upload.

### 2.6.5
## 2.6.5

- fix `openFileDialogOnClick={false}` not to prevent on Enter event.

### 2.6.0 / 2018-09-21
## 2.6.0 / 2018-09-21

- Add `openFileDialogOnClick`.

### 2.5.0 / 2018-06-12
## 2.5.0 / 2018-06-12

- Support upload directory. [#114](https://github.com/react-component/upload/pull/114)
- Support `action={(file) => Promise}`. [#97](https://github.com/react-component/upload/pull/97)
- Fix a bluebird promise warning. [#110](https://github.com/react-component/upload/pull/110)

### 2.4.0 / 2017-07-15
## 2.4.0 / 2017-07-15

- Add XHR for onSuccess callback by @xiangkaiy [!85](https://github.com/react-component/upload/pull/85)

### 2.3.8 / 2017-06-21
## 2.3.8 / 2017-06-21

- fix issue #80 & #81 [#82](https://github.com/react-component/upload/pull/82)

### 2.3.5 / 2017-05-01
## 2.3.5 / 2017-05-01

- Fix prop-types and create-react-class warning [!67](https://github.com/react-component/upload/pull/67)

### 2.3.4 / 2017-03-10
## 2.3.4 / 2017-03-10

- disable upload progress listener in request if onPress is not set [!65](https://github.com/react-component/upload/pull/65)

### 2.3.3 / 2017-02-20
## 2.3.3 / 2017-02-20

- beforeUpload add empty catch function when promise passed, fix [#64](https://github.com/react-component/upload/issues/64)

### 2.3.2 / 2016-12-30
## 2.3.2 / 2016-12-30

- Fix crash if customRequest does not call onSuccess() / onError() [!60](https://github.com/react-component/upload/pull/60)

### 2.3.0 / 2016-12-12
## 2.3.0 / 2016-12-12

- expose file list as argument to `beforeUpload` [!57](https://github.com/react-component/upload/pull/57)

### 2.2.0 / 2016-10-13
## 2.2.0 / 2016-10-13

- support custom request option [!53](https://github.com/react-component/upload/pull/53)

### 2.1.1 / 2016-09-23
## 2.1.1 / 2016-09-23

- support Blob file upload [!52](https://github.com/react-component/upload/pull/52)

### 2.1.0 / 2016-09-20
## 2.1.0 / 2016-09-20

- add `className` prop

### 2.0.0 / 2016-08-10
## 2.0.0 / 2016-08-10

- add abort api
- props.onStart's argument is always a single File
- add disabled prop

### 1.14.1 / 2016-07-19
## 1.14.1 / 2016-07-19

- fix ajax multiple load

### 1.14.0 / 2016-07-19
## 1.14.0 / 2016-07-19

- add component/style prop

### 1.13.0 / 2016-06-02
## 1.13.0 / 2016-06-02

- add disabled state
- https://github.com/react-component/upload/issues/37

### 1.12.0 2016-05-10
## 1.12.0 2016-05-10

- add supportServerRender prop

### 1.11.0 2016-05-03
## 1.11.0 2016-05-03

- Allow all 2xx status as success status, not only 200. fix #34
- When `headers['X-Requested-With'] = null` , request do not set X-Requested-With as XMLHttpRequest , fix #33

### 1.9.0 2016-03-23
## 1.9.0 2016-03-23

- pass file to data if data's type is function

### 1.8.1 2016-03-16
## 1.8.1 2016-03-16

- fix InvalidStateError in IE 10
- fix #30

### 1.8.0 2016-01-14
## 1.8.0 2016-01-14

- support custom XHR headers

### 1.7.2 2016-01-13
## 1.7.2 2016-01-13

- add prop withCredentials config

### 1.7.0 2015-10-27
## 1.7.0 2015-10-27

- react 0.14 support
- remove superagent

### 1.6.6 2015-09-29
## 1.6.6 2015-09-29

- feat: add beforeUpload support, [#19](https://github.com/react-component/upload/pull/19)

### 1.5.2 2015-09-18
## 1.5.2 2015-09-18

- fix: Fixed bug calling wrong method name [#13](https://github.com/react-component/upload/pull/13)

### 1.5.0 2015-09-16
## 1.5.0 2015-09-16

- feat: add getFormContainer prop to decide container where form to be inserted.

### 1.4.4 2015-09-16
## 1.4.4 2015-09-16

- feat: Added aria role and keyboard navigation, pr[#9](https://github.com/react-component/upload/pull/9)

### 1.4.2 2015-09-15
## 1.4.2 2015-09-15

- fix: IframeUpload move form to body [#8](https://github.com/react-component/upload/pull/8)

### 1.4.0 2015-09-09
## 1.4.0 2015-09-09

- onStart file argument change to a array when multiple files uploaded

### 1.3.0 2015-08-12
## 1.3.0 2015-08-12

- onError arguments change to `err, responce, file`

### 1.2.3 2015-07-17
## 1.2.3 2015-07-17

- support file drop

### 1.2.2 2015-06-25
## 1.2.2 2015-06-25

- `fix` pr[#2](https://github.com/react-component/upload/pull/2)

### 1.2.1 2015-06-24
## 1.2.1 2015-06-24

- `feat` Finish basic funcion
3 changes: 3 additions & 0 deletions docs/demo/asyncAction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## asyncAction

<code src="../examples/asyncAction.tsx">
3 changes: 3 additions & 0 deletions docs/demo/beforeUpload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## beforeUpload

<code src="../examples/beforeUpload.tsx">
3 changes: 3 additions & 0 deletions docs/demo/customRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## customRequest

<code src="../examples/customRequest.tsx">
3 changes: 3 additions & 0 deletions docs/demo/directoryUpload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## directoryUpload

<code src="../examples/directoryUpload.tsx">
3 changes: 3 additions & 0 deletions docs/demo/drag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## drag

<code src="../examples/drag.tsx">
3 changes: 3 additions & 0 deletions docs/demo/simple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## simple

<code src="../examples/simple.tsx">
3 changes: 3 additions & 0 deletions docs/demo/transformFile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## transformFile

<code src="../examples/transformFile.tsx">
2 changes: 1 addition & 1 deletion examples/asyncAction.tsx → docs/examples/asyncAction.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint no-console:0 */
import React from 'react';
import Upload from '..';
import Upload from 'rc-upload';

const props = {
action: () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint no-console:0 */

import React from 'react';
import Upload from '..';
import Upload from 'rc-upload';

const props = {
action: '/upload.do',
Expand Down
Loading