Skip to content

Commit f28e4d4

Browse files
committed
new control UploadFiles
1 parent 450b664 commit f28e4d4

Some content is hidden

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

61 files changed

+1443
-97
lines changed
7.9 MB
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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={30}
21+
context={context}
22+
title="Upload Files"
23+
onUploadFiles={(files) => {
24+
console.log("files", files);
25+
}}
26+
themeVariant={themeVariant}
27+
/>
28+
```
29+
30+
31+
![Custom html with drag and drop](../assets/UploadFiles.gif)
32+
33+
## Implementation
34+
35+
The `UploadFiles` can be configured with the following properties:
36+
37+
| Property | Type | Required | Description |
38+
| ---- | ---- | ---- | ---- |
39+
| pageSize | number | no | number of files to show per page base on this value the height is calculate |
40+
| context | WebPartContext | yes | webPartContext |
41+
| title | string | yes | title |
42+
| onUploadFiles | (files: File[]) => void; | yes | Method that returns all Files[] |
43+
| themeVariant | IReadonlyTheme | no |Theme Variant |
44+
45+
46+
47+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/UploadFiles)

package-lock.json

Lines changed: 190 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)