Skip to content

Commit 489e246

Browse files
Merge branch 'joaojmendes-UploadFiles' into dev
2 parents 5bf16f8 + b2a5a2d commit 489e246

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+38291
-133
lines changed
7.9 MB
Loading
702 KB
Loading
589 KB
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# UploadFiles
2+
3+
This control allows to drag and drop files and manage files before upload.
4+
5+
## How to use this control in your solutions
6+
7+
- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency.
8+
- Import the following modules to your component:
9+
10+
```TypeScript
11+
import {
12+
UploadFiles,
13+
} from '@pnp/spfx-controls-react/lib/UploadFiles';
14+
```
15+
16+
- Use the UploadFiles control in your code as follows:
17+
18+
```jsx
19+
<UploadFiles
20+
pageSize={20}
21+
context={context}
22+
title="Upload Files"
23+
onUploadFiles={(files) => {
24+
console.log("files", files);
25+
}}
26+
themeVariant={themeVariant}
27+
/>
28+
```
29+
30+
31+
![uploadFiles](../assets/UploadFiles.gif)
32+
![uploadFiles](../assets/UploadFiles02.png)
33+
![uploadFiles](../assets/UploadFiles01.png)
34+
35+
## Implementation
36+
37+
The `UploadFiles` can be configured with the following properties:
38+
39+
| Property | Type | Required | Description |
40+
| ---- | ---- | ---- | ---- |
41+
| pageSize | number | no | number of files to show per page base on this value the height of control is calculate, default 15 |
42+
| context | WebPartContext | yes | webPartContext |
43+
| title | string | yes | title |
44+
| onUploadFiles | (files: File[]) => void; | yes | Method that returns all Files[] |
45+
| themeVariant | IReadonlyTheme | no |Theme Variant |
46+
47+
48+
49+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/UploadFiles)

docs/documentation/docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ The following controls are currently available:
108108
- [TeamPicker](./controls/TeamPicker) (Team Picker)
109109
- [Toolbar](./controls/Toolbar) (Control to render Toolbar in Microsoft Teams)
110110
- [TreeView](./controls/TreeView) (Tree View)
111+
- [UploadFiles](./controls/UploadFiles) (Upload Files)
111112
- [VariantThemeProvider](./controls/VariantThemeProvider) (Variant Theme Provider)
112113
- [WebPartTitle](./controls/WebPartTitle) (Customizable web part title control)
113114

docs/documentation/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ nav:
6969
- TeamPicker: 'controls/TeamPicker.md'
7070
- Toolbar: 'controls/Toolbar.md'
7171
- TreeView: 'controls/TreeView.md'
72+
- UploadFiles: 'controls/UploadFiles.md'
7273
- VariantThemeProvider: 'controls/VariantThemeProvider.md'
7374
- WebPartTitle: 'controls/WebPartTitle.md'
7475
- 'Field Controls':

0 commit comments

Comments
 (0)