Skip to content

Commit

Permalink
Small fixes/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 14, 2024
1 parent 7de389a commit 228860c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions panel/models/file_dropper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class FileDropperView extends InputWidgetView {
super.initialize();
(window as any).FilePond.registerPlugin((window as any).FilePondPluginImagePreview);
(window as any).FilePond.registerPlugin((window as any).FilePondPluginPdfPreview);
(window as any).FilePond.registerPlugin((window as any).FilePondPluginFileValidateType);
(window as any).FilePond.registerPlugin((window as any).FilePondPluginFileValidateSize)
}

Expand Down
15 changes: 9 additions & 6 deletions panel/widgets/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ class FileDropper(Widget):
"""

accepted_filetypes = param.List(default=[], doc="""
List of accepted file types. Can be mime types or wild cards.
For instance ['image/*'] will accept all images.
['image/png', 'image/jpeg'] will only accepts PNGs and JPEGs.""")
List of accepted file types. Can be mime types, file extensions
or wild cards.For instance ['image/*'] will accept all images.
['.png', 'image/jpeg'] will only accepts PNGs and JPEGs.""")

chunk_size = param.Integer(default=10_000_000, doc="""
Size in bytes per chunk transferred across the WebSocket.""")
Expand All @@ -322,7 +322,7 @@ class FileDropper(Widget):
Maximum size of a file as a string with units given in KB or MB,
e.g. 5MB or 750KB.""")

max_files = param.String(default=None, doc="""
max_files = param.Integer(default=None, doc="""
Maximum number of files that can be uploaded if multiple=True.""")

max_total_file_size = param.String(default=None, doc="""
Expand All @@ -334,14 +334,17 @@ class FileDropper(Widget):
files indexed by their filename.""")

multiple = param.Boolean(default=False, doc="""
Whether to allow uploading multiple files. If enabled value
parameter will return a list.""")
Whether to allow uploading multiple files.""")

value = param.Dict(default={}, doc="""
A dictionary containing the uploaded file(s) as bytes or string
objects indexed by the filename. Files that have a text/* mimetype
will automatically be decoded as utf-8.""")

width = param.Integer(default=300, allow_None=True, doc="""
Width of this component. If sizing_mode is set to stretch
or scale mode this will merely be used as a suggestion.""")

_rename = {'value': None}

def __init__(self, **params):
Expand Down

0 comments on commit 228860c

Please sign in to comment.