Skip to content

Commit fb6a353

Browse files
Merge branch 'UploadFiles' of https://github.com/joaojmendes/sp-dev-fx-controls-react into joaojmendes-UploadFiles
2 parents 393b8d3 + 1b8870d commit fb6a353

Some content is hidden

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

76 files changed

+1650
-213
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)

package-lock.json

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

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"prepare": "husky install"
2121
},
2222
"dependencies": {
23+
"@fluentui/react-file-type-icons": "^8.8.3",
2324
"@fluentui/react-hooks": "^8.2.6",
2425
"@fluentui/react-northstar": "0.51.3",
2526
"@fluentui/react-theme-provider": "^0.18.5",
@@ -48,6 +49,7 @@
4849
"color": "3.1.2",
4950
"date-fns": "^2.22.1",
5051
"he": "^1.2.0",
52+
"jotai": "^1.11.0",
5153
"lodash": "4.17.21",
5254
"markdown-it": "^12.3.2",
5355
"moment": "2.29.4",
12.3 KB
Loading
12.5 KB
Loading

0 commit comments

Comments
 (0)