@uppy/provider-views
Advanced tools
Comparing version 2.1.0 to 2.1.1
# @uppy/provider-views | ||
## 2.1.1 | ||
Released: 2022-05-30 | ||
Included in: Uppy v2.11.0 | ||
- @uppy/provider-views: Add onKeyPress event handler to capture e.shiftKey, unavailable in onChange (Artur Paikin / #3768) | ||
## 2.1.0 | ||
@@ -4,0 +11,0 @@ |
@@ -28,2 +28,3 @@ "use strict"; | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
handleScroll, | ||
@@ -80,2 +81,3 @@ showTitles, | ||
toggleCheckbox: event => toggleCheckbox(event, folder), | ||
recordShiftKeyPress, | ||
type: 'folder', | ||
@@ -95,2 +97,3 @@ isDisabled: (_isChecked = isChecked(folder)) == null ? void 0 : _isChecked.loading, | ||
toggleCheckbox: event => toggleCheckbox(event, file), | ||
recordShiftKeyPress, | ||
columns, | ||
@@ -97,0 +100,0 @@ showTitles, |
@@ -8,8 +8,8 @@ "use strict"; | ||
const ProviderViews = require("./ProviderView/index.js"); | ||
const _0 = require("./ProviderView/index.js"); | ||
exports.ProviderViews = ProviderViews; | ||
exports.ProviderViews = _0; | ||
const SearchProviderViews = require("./SearchProviderView/index.js"); | ||
const _1 = require("./SearchProviderView/index.js"); | ||
exports.SearchProviderViews = SearchProviderViews; | ||
exports.SearchProviderViews = _1; |
@@ -15,2 +15,3 @@ "use strict"; | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
id, | ||
@@ -26,2 +27,3 @@ children | ||
onChange: toggleCheckbox, | ||
onKeyDown: recordShiftKeyPress, | ||
name: "listitem", | ||
@@ -28,0 +30,0 @@ id: id, |
@@ -19,2 +19,3 @@ "use strict"; | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
type, | ||
@@ -34,3 +35,4 @@ id, | ||
className: `uppy-u-reset uppy-ProviderBrowserItem-checkbox ${isChecked ? 'uppy-ProviderBrowserItem-checkbox--is-checked' : ''}`, | ||
onChange: toggleCheckbox // for the <label/> | ||
onChange: toggleCheckbox, | ||
onKeyDown: recordShiftKeyPress // for the <label/> | ||
, | ||
@@ -37,0 +39,0 @@ name: "listitem", |
@@ -24,3 +24,3 @@ "use strict"; | ||
const packageJson = { | ||
"version": "2.1.0" | ||
"version": "2.1.1" | ||
}; | ||
@@ -398,2 +398,3 @@ | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
filterItems | ||
@@ -415,2 +416,3 @@ } = this.sharedHandler; | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
currentSelection, | ||
@@ -417,0 +419,0 @@ files: hasInput ? filterItems(files) : files, |
@@ -24,3 +24,3 @@ "use strict"; | ||
const packageJson = { | ||
"version": "2.1.0" | ||
"version": "2.1.1" | ||
}; | ||
@@ -27,0 +27,0 @@ /** |
@@ -10,2 +10,3 @@ "use strict"; | ||
this.toggleCheckbox = this.toggleCheckbox.bind(this); | ||
this.recordShiftKeyPress = this.recordShiftKeyPress.bind(this); | ||
this.isChecked = this.isChecked.bind(this); | ||
@@ -26,2 +27,6 @@ this.loaderWrapper = this.loaderWrapper.bind(this); | ||
} | ||
recordShiftKeyPress(e) { | ||
this.isShiftKeyPressed = e.shiftKey; | ||
} | ||
/** | ||
@@ -47,3 +52,3 @@ * Toggles file/folder checkbox to on/off state while updating files list. | ||
if (this.lastCheckbox && e.shiftKey) { | ||
if (this.lastCheckbox && this.isShiftKeyPressed) { | ||
const prevIndex = items.indexOf(this.lastCheckbox); | ||
@@ -50,0 +55,0 @@ const currentIndex = items.indexOf(file); |
{ | ||
"name": "@uppy/provider-views", | ||
"description": "View library for Uppy remote provider plugins.", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"license": "MIT", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/utils": "^4.0.7", | ||
"@uppy/utils": "^4.1.0", | ||
"classnames": "^2.2.6", | ||
@@ -29,4 +29,4 @@ "preact": "^10.5.13" | ||
"peerDependencies": { | ||
"@uppy/core": "^2.2.0" | ||
"@uppy/core": "^2.3.0" | ||
} | ||
} |
@@ -24,2 +24,3 @@ import { h } from 'preact' | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
handleScroll, | ||
@@ -95,2 +96,3 @@ showTitles, | ||
toggleCheckbox: (event) => toggleCheckbox(event, folder), | ||
recordShiftKeyPress, | ||
type: 'folder', | ||
@@ -116,2 +118,3 @@ isDisabled: isChecked(folder)?.loading, | ||
toggleCheckbox: (event) => toggleCheckbox(event, file), | ||
recordShiftKeyPress, | ||
columns, | ||
@@ -118,0 +121,0 @@ showTitles, |
@@ -13,2 +13,3 @@ import { h } from 'preact' | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
id, | ||
@@ -29,2 +30,3 @@ children, | ||
onChange={toggleCheckbox} | ||
onKeyDown={recordShiftKeyPress} | ||
name="listitem" | ||
@@ -31,0 +33,0 @@ id={id} |
@@ -18,2 +18,3 @@ import { h } from 'preact' | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
type, | ||
@@ -38,2 +39,3 @@ id, | ||
onChange={toggleCheckbox} | ||
onKeyDown={recordShiftKeyPress} | ||
// for the <label/> | ||
@@ -40,0 +42,0 @@ name="listitem" |
@@ -335,3 +335,3 @@ import { h } from 'preact' | ||
const { files, folders, filterInput, loading, currentSelection } = this.plugin.getPluginState() | ||
const { isChecked, toggleCheckbox, filterItems } = this.sharedHandler | ||
const { isChecked, toggleCheckbox, recordShiftKeyPress, filterItems } = this.sharedHandler | ||
const hasInput = filterInput !== '' | ||
@@ -352,2 +352,3 @@ const headerProps = { | ||
toggleCheckbox, | ||
recordShiftKeyPress, | ||
currentSelection, | ||
@@ -354,0 +355,0 @@ files: hasInput ? filterItems(files) : files, |
@@ -8,2 +8,3 @@ import remoteFileObjToLocal from '@uppy/utils/lib/remoteFileObjToLocal' | ||
this.toggleCheckbox = this.toggleCheckbox.bind(this) | ||
this.recordShiftKeyPress = this.recordShiftKeyPress.bind(this) | ||
this.isChecked = this.isChecked.bind(this) | ||
@@ -23,2 +24,6 @@ this.loaderWrapper = this.loaderWrapper.bind(this) | ||
recordShiftKeyPress (e) { | ||
this.isShiftKeyPressed = e.shiftKey | ||
} | ||
/** | ||
@@ -37,6 +42,5 @@ * Toggles file/folder checkbox to on/off state while updating files list. | ||
const items = this.filterItems(folders.concat(files)) | ||
// Shift-clicking selects a single consecutive list of items | ||
// starting at the previous click and deselects everything else. | ||
if (this.lastCheckbox && e.shiftKey) { | ||
if (this.lastCheckbox && this.isShiftKeyPressed) { | ||
const prevIndex = items.indexOf(this.lastCheckbox) | ||
@@ -43,0 +47,0 @@ const currentIndex = items.indexOf(file) |
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
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
243034
3558
Updated@uppy/utils@^4.1.0