Skip to content

Commit fd5c109

Browse files
authored
chore: use dumi (#289)
* chore: use dumi * fix lint * update changelog * update online url
1 parent 4a6eab6 commit fd5c109

26 files changed

+206
-70
lines changed

.editorconfig

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
# top-most EditorConfig file
1+
# http://editorconfig.org
22
root = true
33

4-
# Unix-style newlines with a newline ending every file
5-
[*.{js,css}]
6-
end_of_line = lf
7-
insert_final_newline = true
4+
[*]
85
indent_style = space
96
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ module.exports = {
99
"@typescript-eslint/no-explicit-any": 0,
1010
"@typescript-eslint/no-empty-interface": 0,
1111
"@typescript-eslint/no-inferrable-types": 0,
12+
"@typescript-eslint/no-unused-vars": 0,
1213
"react/no-find-dom-node": 0,
1314
"react/require-default-props": 0,
1415
"no-confusing-arrow": 0,
1516
"import/no-named-as-default-member": 0,
1617
"jsx-a11y/label-has-for": 0,
1718
"jsx-a11y/label-has-associated-control": 0,
19+
"import/no-named-as-default": 0,
1820
"import/no-extraneous-dependencies": 0,
1921
"no-underscore-dangle": 0,
2022
},

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ tmp/
3232
.history
3333
.storybook
3434
.doc
35+
36+
# umi
37+
.umi
38+
.umi-production
39+
.umi-test
40+
.env.local

.umirc.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// more config: https://d.umijs.org/config
2+
import { defineConfig } from 'dumi';
3+
4+
const name = 'rc-upload';
5+
6+
export default defineConfig({
7+
title: name,
8+
favicon:
9+
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
10+
logo:
11+
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
12+
outputPath: '.doc',
13+
exportStatic: {},
14+
styles: [
15+
`a img + svg {
16+
display: none;
17+
}`
18+
],
19+
scripts: [{
20+
content: `
21+
(function () {
22+
var timer = setInterval(function() {
23+
try {
24+
var menuList = document.getElementsByClassName('__dumi-default-menu-list');
25+
menuList[0].childNodes[0].childNodes[0].innerText = '${name}';
26+
clearInterval(timer);
27+
} catch (e) {}
28+
}, 200)
29+
})();
30+
`
31+
}]
32+
});

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016-present react-component
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# rc-upload
2-
---
32

43
React Upload
54

6-
[![NPM version][npm-image]][npm-url]
7-
[![build status][travis-image]][travis-url]
8-
[![Test coverage][coveralls-image]][coveralls-url]
9-
[![Dependencies][david-image]][david-url]
10-
[![DevDependencies][david-dev-image]][david-dev-url]
11-
[![npm download][download-image]][download-url]
12-
[![bundle size][bundlephobia-image]][bundlephobia-url]
5+
[![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]
136

147
[npm-image]: https://img.shields.io/npm/v/rc-upload.svg?style=flat-square
158
[npm-url]: http://npmjs.org/package/rc-upload
@@ -37,10 +30,9 @@ npm start
3730

3831
## Example
3932

40-
http://localhost:8020/examples/
41-
42-
online example: https://react-component.github.io/upload/
33+
http://localhost:8000/
4334

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

4537
## Feature
4638

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,176 +1,179 @@
1-
# History
2-
----
1+
# Changelog
32

4-
### 3.3.0
3+
## 3.3.1
4+
5+
- refatcor: change timeout to promise. [#277](https://github.com/react-component/upload/pull/277)
6+
7+
## 3.3.0
58

69
`2020-08-31`
710

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

10-
### 3.2.0
13+
## 3.2.0
1114

1215
- support `onClick` `onMouseEnter` `onMouseLeave`.
1316

14-
### 3.1.0
17+
## 3.1.0
1518

1619
- `data` could return Promise.
1720

18-
### 3.0.0
21+
## 3.0.0
1922

2023
- Drop support of IE8/9.
2124

22-
### 2.9.0
25+
## 2.9.0
2326

2427
- Support `method`. #197
2528

26-
### 2.8.0
29+
## 2.8.0
2730

2831
- `multiple` will works on drag upload.
2932

30-
### 2.7.0
33+
## 2.7.0
3134

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

34-
### 2.6.5
37+
## 2.6.5
3538

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

38-
### 2.6.0 / 2018-09-21
41+
## 2.6.0 / 2018-09-21
3942

4043
- Add `openFileDialogOnClick`.
4144

42-
### 2.5.0 / 2018-06-12
45+
## 2.5.0 / 2018-06-12
4346

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

48-
### 2.4.0 / 2017-07-15
51+
## 2.4.0 / 2017-07-15
4952

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

52-
### 2.3.8 / 2017-06-21
55+
## 2.3.8 / 2017-06-21
5356

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

56-
### 2.3.5 / 2017-05-01
59+
## 2.3.5 / 2017-05-01
5760

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

60-
### 2.3.4 / 2017-03-10
63+
## 2.3.4 / 2017-03-10
6164

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

64-
### 2.3.3 / 2017-02-20
67+
## 2.3.3 / 2017-02-20
6568

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

68-
### 2.3.2 / 2016-12-30
71+
## 2.3.2 / 2016-12-30
6972

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

72-
### 2.3.0 / 2016-12-12
75+
## 2.3.0 / 2016-12-12
7376

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

76-
### 2.2.0 / 2016-10-13
79+
## 2.2.0 / 2016-10-13
7780

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

80-
### 2.1.1 / 2016-09-23
83+
## 2.1.1 / 2016-09-23
8184

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

84-
### 2.1.0 / 2016-09-20
87+
## 2.1.0 / 2016-09-20
8588

8689
- add `className` prop
8790

88-
### 2.0.0 / 2016-08-10
91+
## 2.0.0 / 2016-08-10
8992

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

94-
### 1.14.1 / 2016-07-19
97+
## 1.14.1 / 2016-07-19
9598

9699
- fix ajax multiple load
97100

98-
### 1.14.0 / 2016-07-19
101+
## 1.14.0 / 2016-07-19
99102

100103
- add component/style prop
101104

102-
### 1.13.0 / 2016-06-02
105+
## 1.13.0 / 2016-06-02
103106

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

107-
### 1.12.0 2016-05-10
110+
## 1.12.0 2016-05-10
108111

109112
- add supportServerRender prop
110113

111-
### 1.11.0 2016-05-03
114+
## 1.11.0 2016-05-03
112115

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

116-
### 1.9.0 2016-03-23
119+
## 1.9.0 2016-03-23
117120

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

120-
### 1.8.1 2016-03-16
123+
## 1.8.1 2016-03-16
121124

122125
- fix InvalidStateError in IE 10
123126
- fix #30
124127

125-
### 1.8.0 2016-01-14
128+
## 1.8.0 2016-01-14
126129

127130
- support custom XHR headers
128131

129-
### 1.7.2 2016-01-13
132+
## 1.7.2 2016-01-13
130133

131134
- add prop withCredentials config
132135

133-
### 1.7.0 2015-10-27
136+
## 1.7.0 2015-10-27
134137

135138
- react 0.14 support
136139
- remove superagent
137140

138-
### 1.6.6 2015-09-29
141+
## 1.6.6 2015-09-29
139142

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

142-
### 1.5.2 2015-09-18
145+
## 1.5.2 2015-09-18
143146

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

146-
### 1.5.0 2015-09-16
149+
## 1.5.0 2015-09-16
147150

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

150-
### 1.4.4 2015-09-16
153+
## 1.4.4 2015-09-16
151154

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

154-
### 1.4.2 2015-09-15
157+
## 1.4.2 2015-09-15
155158

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

158-
### 1.4.0 2015-09-09
161+
## 1.4.0 2015-09-09
159162

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

162-
### 1.3.0 2015-08-12
165+
## 1.3.0 2015-08-12
163166

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

166-
### 1.2.3 2015-07-17
169+
## 1.2.3 2015-07-17
167170

168171
- support file drop
169172

170-
### 1.2.2 2015-06-25
173+
## 1.2.2 2015-06-25
171174

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

174-
### 1.2.1 2015-06-24
177+
## 1.2.1 2015-06-24
175178

176179
- `feat` Finish basic funcion

docs/demo/asyncAction.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## asyncAction
2+
3+
<code src="../examples/asyncAction.tsx">

docs/demo/beforeUpload.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## beforeUpload
2+
3+
<code src="../examples/beforeUpload.tsx">

docs/demo/customRequest.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## customRequest
2+
3+
<code src="../examples/customRequest.tsx">

docs/demo/directoryUpload.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## directoryUpload
2+
3+
<code src="../examples/directoryUpload.tsx">

docs/demo/drag.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## drag
2+
3+
<code src="../examples/drag.tsx">

docs/demo/simple.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## simple
2+
3+
<code src="../examples/simple.tsx">

docs/demo/transformFile.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## transformFile
2+
3+
<code src="../examples/transformFile.tsx">

examples/asyncAction.tsx renamed to docs/examples/asyncAction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint no-console:0 */
22
import React from 'react';
3-
import Upload from '..';
3+
import Upload from 'rc-upload';
44

55
const props = {
66
action: () => {

examples/beforeUpload.tsx renamed to docs/examples/beforeUpload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint no-console:0 */
22

33
import React from 'react';
4-
import Upload from '..';
4+
import Upload from 'rc-upload';
55

66
const props = {
77
action: '/upload.do',

0 commit comments

Comments
 (0)