Forráskód Böngészése

fix `super.toggleCheckbox` bug (#5004)

* upgrade typescript to 5.4

* fix toggleCheckbox bug

by making toggleCheckbox an instance method again

* degrade typescript for angular

* fix tsconfig for e2e

* Revert "fix tsconfig for e2e"

This reverts commit a4c8be01e381f68c7e69d680c878f408c4058aa0.

* Revert "upgrade typescript to 5.4"

This reverts commit 2c66a5265c0e1839337f8c19b3f3628b4ba40a42.

* Revert "degrade typescript for angular"

This reverts commit bb3db4a8a0060041bb68af3a44b0397d1cd3ad3e.

* Update packages/@uppy/angular/package.json

* Update yarn.lock

---------

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
Mikael Finstad 1 éve
szülő
commit
48f4f341d2

+ 1 - 1
packages/@uppy/google-drive/src/DriveProviderViews.ts

@@ -6,7 +6,7 @@ export default class DriveProviderViews<
   M extends Meta,
   B extends Body,
 > extends ProviderViews<M, B> {
-  toggleCheckbox = (e: Event, file: CompanionFile): void => {
+  toggleCheckbox(e: Event, file: CompanionFile): void {
     e.stopPropagation()
     e.preventDefault()
 

+ 2 - 2
packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx

@@ -558,7 +558,7 @@ export default class ProviderView<M extends Meta, B extends Body> extends View<
     const targetViewOptions = { ...this.opts, ...viewOptions }
     const { files, folders, filterInput, loading, currentSelection } =
       this.plugin.getPluginState()
-    const { isChecked, toggleCheckbox, recordShiftKeyPress, filterItems } = this
+    const { isChecked, recordShiftKeyPress, filterItems } = this
     const hasInput = filterInput !== ''
     const pluginIcon = this.plugin.icon || defaultPickerIcon
 
@@ -575,7 +575,7 @@ export default class ProviderView<M extends Meta, B extends Body> extends View<
 
     const browserProps = {
       isChecked,
-      toggleCheckbox,
+      toggleCheckbox: this.toggleCheckbox.bind(this),
       recordShiftKeyPress,
       currentSelection,
       files: hasInput ? filterItems(files) : files,

+ 2 - 2
packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx

@@ -167,12 +167,12 @@ export default class SearchProviderView<
     const targetViewOptions = { ...this.opts, ...viewOptions }
     const { files, folders, filterInput, loading, currentSelection } =
       this.plugin.getPluginState()
-    const { isChecked, toggleCheckbox, filterItems, recordShiftKeyPress } = this
+    const { isChecked, filterItems, recordShiftKeyPress } = this
     const hasInput = filterInput !== ''
 
     const browserProps = {
       isChecked,
-      toggleCheckbox,
+      toggleCheckbox: this.toggleCheckbox.bind(this),
       recordShiftKeyPress,
       currentSelection,
       files: hasInput ? filterItems(files) : files,

+ 1 - 1
packages/@uppy/provider-views/src/View.ts

@@ -199,7 +199,7 @@ export default class View<
    * toggle multiple checkboxes at once, which is done by getting all files
    * in between last checked file and current one.
    */
-  toggleCheckbox = (e: Event, file: CompanionFile): void => {
+  toggleCheckbox(e: Event, file: CompanionFile): void {
     e.stopPropagation()
     e.preventDefault()
     ;(e.currentTarget as HTMLInputElement).focus()