@uppy/status-bar
Advanced tools
Comparing version 0.29.0 to 0.29.1
@@ -231,2 +231,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var resumableUploads = capabilities.resumableUploads || false; | ||
var supportsUploadProgress = capabilities.uploadProgress !== false; | ||
@@ -257,2 +258,3 @@ return StatusBarUI({ | ||
resumableUploads: resumableUploads, | ||
supportsUploadProgress: supportsUploadProgress, | ||
showProgressDetails: this.opts.showProgressDetails, | ||
@@ -259,0 +261,0 @@ hideUploadButton: this.opts.hideUploadButton, |
@@ -93,2 +93,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
} else if (uploadState === statusBarStates.STATE_UPLOADING) { | ||
if (!props.supportsUploadProgress) { | ||
progressMode = 'indeterminate'; | ||
progressValue = null; | ||
} | ||
progressBarContent = ProgressBarUploading(props); | ||
@@ -229,2 +234,10 @@ } else if (uploadState === statusBarStates.STATE_ERROR) { | ||
var UnknownProgressDetails = function UnknownProgressDetails(props) { | ||
return h( | ||
'div', | ||
{ 'class': 'uppy-StatusBar-statusSecondary' }, | ||
props.i18n('filesUploadedOfTotal', { complete: props.complete, smart_count: props.numUploads }) | ||
); | ||
}; | ||
var UploadNewlyAddedFiles = function UploadNewlyAddedFiles(props) { | ||
@@ -272,8 +285,5 @@ var uploadBtnClassNames = classNames('uppy-u-reset', 'uppy-c-btn', 'uppy-StatusBar-actionBtn'); | ||
{ 'class': 'uppy-StatusBar-statusPrimary' }, | ||
title, | ||
': ', | ||
props.totalProgress, | ||
'%' | ||
props.supportsUploadProgress ? title + ': ' + props.totalProgress + '%' : title | ||
), | ||
!props.isAllPaused && !showUploadNewlyAddedFiles && props.showProgressDetails ? h(ThrottledProgressDetails, props) : null, | ||
!props.isAllPaused && !showUploadNewlyAddedFiles && props.showProgressDetails ? props.supportsUploadProgress ? h(ThrottledProgressDetails, props) : h(UnknownProgressDetails, props) : null, | ||
showUploadNewlyAddedFiles ? h(UploadNewlyAddedFiles, props) : null | ||
@@ -280,0 +290,0 @@ ) |
{ | ||
"name": "@uppy/status-bar", | ||
"description": "A progress bar for Uppy, with many bells and whistles.", | ||
"version": "0.29.0", | ||
"version": "0.29.1", | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"jsnext:main": "src/index.js", | ||
"style": "dist/style.min.css", | ||
@@ -30,3 +29,3 @@ "types": "types/index.d.ts", | ||
"dependencies": { | ||
"@uppy/utils": "0.29.0", | ||
"@uppy/utils": "0.29.1", | ||
"classnames": "^2.2.6", | ||
@@ -38,3 +37,3 @@ "lodash.throttle": "^4.1.1", | ||
"devDependencies": { | ||
"@uppy/core": "0.29.0" | ||
"@uppy/core": "0.29.1" | ||
}, | ||
@@ -44,3 +43,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "c68f2c7e68d2c12f8a8fb7119f1dae4ca08e4174" | ||
"gitHead": "3ddf4c7548766a0c522b9a45c03b1fd7d4e03d43" | ||
} |
@@ -225,2 +225,3 @@ const { Plugin } = require('@uppy/core') | ||
const resumableUploads = capabilities.resumableUploads || false | ||
const supportsUploadProgress = capabilities.uploadProgress !== false | ||
@@ -250,3 +251,4 @@ return StatusBarUI({ | ||
startUpload: this.startUpload, | ||
resumableUploads: resumableUploads, | ||
resumableUploads, | ||
supportsUploadProgress, | ||
showProgressDetails: this.opts.showProgressDetails, | ||
@@ -253,0 +255,0 @@ hideUploadButton: this.opts.hideUploadButton, |
@@ -83,2 +83,7 @@ const throttle = require('lodash.throttle') | ||
} else if (uploadState === statusBarStates.STATE_UPLOADING) { | ||
if (!props.supportsUploadProgress) { | ||
progressMode = 'indeterminate' | ||
progressValue = null | ||
} | ||
progressBarContent = ProgressBarUploading(props) | ||
@@ -218,2 +223,8 @@ } else if (uploadState === statusBarStates.STATE_ERROR) { | ||
const UnknownProgressDetails = (props) => { | ||
return <div class="uppy-StatusBar-statusSecondary"> | ||
{ props.i18n('filesUploadedOfTotal', { complete: props.complete, smart_count: props.numUploads }) } | ||
</div> | ||
} | ||
const UploadNewlyAddedFiles = (props) => { | ||
@@ -253,5 +264,7 @@ const uploadBtnClassNames = classNames( | ||
<div class="uppy-StatusBar-status"> | ||
<div class="uppy-StatusBar-statusPrimary">{title}: {props.totalProgress}%</div> | ||
<div class="uppy-StatusBar-statusPrimary"> | ||
{props.supportsUploadProgress ? `${title}: ${props.totalProgress}%` : title} | ||
</div> | ||
{ !props.isAllPaused && !showUploadNewlyAddedFiles && props.showProgressDetails | ||
? <ThrottledProgressDetails {...props} /> | ||
? (props.supportsUploadProgress ? <ThrottledProgressDetails {...props} /> : <UnknownProgressDetails {...props} />) | ||
: null | ||
@@ -258,0 +271,0 @@ } |
@@ -1,17 +0,21 @@ | ||
import { Plugin, PluginOptions, Uppy } from '@uppy/core'; | ||
import Uppy = require('@uppy/core'); | ||
export interface StatusBarOptions extends PluginOptions { | ||
showProgressDetails: boolean; | ||
hideUploadButton: boolean; | ||
hideAfterFinish: boolean; | ||
declare module StatusBar { | ||
export interface StatusBarOptions extends Uppy.PluginOptions { | ||
showProgressDetails: boolean; | ||
hideUploadButton: boolean; | ||
hideAfterFinish: boolean; | ||
} | ||
} | ||
export default class StatusBar extends Plugin { | ||
constructor(uppy: Uppy, opts: Partial<StatusBarOptions>); | ||
declare class StatusBar extends Uppy.Plugin { | ||
constructor(uppy: Uppy.Uppy, opts: Partial<StatusBar.StatusBarOptions>); | ||
} | ||
export = StatusBar; | ||
declare module '@uppy/core' { | ||
export interface Uppy { | ||
use(pluginClass: typeof StatusBar, opts: Partial<StatusBarOptions>): Uppy; | ||
use(pluginClass: typeof StatusBar, opts: Partial<StatusBar.StatusBarOptions>): Uppy.Uppy; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
82971
1449
- Removed@uppy/utils@0.29.0(transitive)
Updated@uppy/utils@0.29.1