Skip to content

Commit b5aaa2c

Browse files
authoredMay 25, 2020
Merge pull request #29 from Bunlong/3.3.0
Disable progress bar
2 parents 1e4b32e + 5d95427 commit b5aaa2c

File tree

5 files changed

+34
-22
lines changed

5 files changed

+34
-22
lines changed
 

‎docs/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs",
3-
"version": "1.0.0",
3+
"version": "3.3.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
@@ -17,6 +17,7 @@
1717
"raw-loader": "^4.0.0",
1818
"react": "^16.12.0",
1919
"react-dom": "^16.12.0",
20+
"react-papaparse": "^3.3.0",
2021
"react-tabs": "^3.1.0"
2122
}
2223
}

‎docs/src/components/screens/docs/CSVToJSON.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ const CSVToJSON = () => {
7272
<li><code>onError</code> is error handling function.</li>
7373
<li><code>noClick</code> If true, disables click to open the native file selection dialog.</li>
7474
<li><code>noDrag</code> If true, disables drag 'n' drop.</li>
75-
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
75+
<li><code>noProgressBar</code> If true, disables progress bar.</li>
7676
<li><code>progressBarColor</code> is a property to be used to set the color of progress bar (for example, <code>progressBarColor='#659cef'</code>).</li>
7777
<li><code>style</code> is some styles to be applied to the <code>{'<input>'}</code> element.</li>
78+
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
7879
<li>Doesn't return anything. Results are provided asynchronously to a callback function.</li>
7980
</ul>
8081
</div>
@@ -106,10 +107,11 @@ const CSVToJSON = () => {
106107
<ul>
107108
<li><code>onDrop</code> is the function to be called passing loaded results.</li>
108109
<li><code>onError</code> is error handling function.</li>
109-
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
110+
<li><code>noProgressBar</code> If true, disables progress bar.</li>
110111
<li><code>progressBarColor</code> is a property to be used to set the color of progress bar (for example, <code>progressBarColor='#659cef'</code>).</li>
111112
<li><code>style</code> is some styles to be applied to the <code>{'<input>'}</code> element.</li>
112113
<li><code>addRemoveButton</code> If true, this will add a button to remove or cancel (if already uploading) the file.</li>
114+
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
113115
<li>Doesn't return anything. Results are provided asynchronously to a callback function.</li>
114116
</ul>
115117
</div>
@@ -143,10 +145,11 @@ const CSVToJSON = () => {
143145
<li><code>onDrop</code> is the function to be called passing loaded results.</li>
144146
<li><code>onError</code> is error handling function.</li>
145147
<li><code>noClick</code> If true, disables click to open the native file selection dialog.</li>
146-
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
148+
<li><code>noProgressBar</code> If true, disables progress bar.</li>
147149
<li><code>progressBarColor</code> is a property to be used to set the color of progress bar (for example, <code>progressBarColor='#659cef'</code>).</li>
148150
<li><code>style</code> is some styles to be applied to the <code>{'<input>'}</code> element.</li>
149151
<li><code>addRemoveButton</code> If true, this will add a button to remove or cancel (if already uploading) the file.</li>
152+
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
150153
<li>Doesn't return anything. Results are provided asynchronously to a callback function.</li>
151154
</ul>
152155
</div>
@@ -180,10 +183,11 @@ const CSVToJSON = () => {
180183
<li><code>onDrop</code> is the function to be called passing loaded results.</li>
181184
<li><code>onError</code> is error handling function.</li>
182185
<li><code>noDrag</code> If true, disables drag 'n' drop.</li>
183-
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
186+
<li><code>noProgressBar</code> If true, disables progress bar.</li>
184187
<li><code>progressBarColor</code> is a property to be used to set the color of progress bar (for example, <code>progressBarColor='#659cef'</code>).</li>
185188
<li><code>style</code> is some styles to be applied to the <code>{'<input>'}</code> element.</li>
186189
<li><code>addRemoveButton</code> If true, this will add a button to remove or cancel (if already uploading) the file.</li>
190+
<li><code>config</code> is a <a href='#config'>config object</a> which contains a callback.</li>
187191
<li>Doesn't return anything. Results are provided asynchronously to a callback function.</li>
188192
</ul>
189193
</div>

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-papaparse",
3-
"version": "3.2.1",
3+
"version": "3.3.0",
44
"description": "Fast and powerful React CSV parser for the browser that supports web workers and streaming large files. Converts CSV to JSON and JSON to CSV.",
55
"author": "Bunlong <bunlong.van@gmail.com>",
66
"license": "MIT",

‎src/CSVReader.tsx

+22-15
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ interface Props {
8989
progressBarColor?: string;
9090
addRemoveButton?: boolean;
9191
onRemoveFile?: (data: any) => void;
92+
noProgressBar?: boolean;
9293
}
9394

9495
interface State {
@@ -439,13 +440,16 @@ export default class CSVReader extends React.Component<Props, State> {
439440
ref={this.fileNameInfoRef}
440441
/>
441442
</div>
442-
{files && files.length > 0 && !isCanceled && (
443-
<ProgressBar
444-
progressBarColor={progressBarColor || ''}
445-
progressBar={progressBar}
446-
displayProgressBarStatus={displayProgressBarStatus}
447-
/>
448-
)}
443+
{files &&
444+
files.length > 0 &&
445+
!isCanceled &&
446+
!this.props.noProgressBar && (
447+
<ProgressBar
448+
progressBarColor={progressBarColor || ''}
449+
progressBar={progressBar}
450+
displayProgressBarStatus={displayProgressBarStatus}
451+
/>
452+
)}
449453
</div>
450454
) : (
451455
children
@@ -454,14 +458,17 @@ export default class CSVReader extends React.Component<Props, State> {
454458
) : (
455459
<div ref={this.dropAreaRef}>
456460
{this.renderChildren()}
457-
{files && files.length > 0 && !isCanceled && (
458-
<ProgressBar
459-
progressBarColor={progressBarColor || ''}
460-
progressBar={progressBar}
461-
displayProgressBarStatus={displayProgressBarStatus}
462-
isButtonProgressBar
463-
/>
464-
)}
461+
{files &&
462+
files.length > 0 &&
463+
!isCanceled &&
464+
!this.props.noProgressBar && (
465+
<ProgressBar
466+
progressBarColor={progressBarColor || ''}
467+
progressBar={progressBar}
468+
displayProgressBarStatus={displayProgressBarStatus}
469+
isButtonProgressBar
470+
/>
471+
)}
465472
</div>
466473
)}
467474
</>

‎supports/default/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "create-next-app-cli",
2+
"name": "create-next-app",
33
"version": "0.1.0",
44
"description": "",
55
"main": "index.js",

0 commit comments

Comments
 (0)