You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The file picker component provides a button, a drop down list of files, and as well as button to launch a full file browsing experience to enable a user to select a file from OneDrive or SharePoint for further action. This component uses the [mgt-file-list](./mgt-file-list.md)component to display files in the dropdown. The selected file object(s) is returned to the developer.
3
+
The file picker component provides a button, a drop down list of files, and as well as button to launch a full file browsing experience to enable a user to select a file from OneDrive or SharePoint for further action. This component uses the [mgt-file](./mgt-file.md)components to display files in the dropdown. The selected file object(s) is returned to the developer.
4
4
5
5
<imgsrc="./images/mgt-file-picker.png"/>
6
6
7
7
## Supported functionality
8
8
9
9
| Feature | Priority | Notes |
10
10
| ------- | -------- | ----- |
11
+
|**v1**|||
11
12
| Provide a button that renders a drop down when clicked | P0 ||
12
-
| Retrieve a list of files based on information provided| P0 ||
13
-
| Use the `mgt-file-list` component to render the list inside of the drop down | P0 ||
14
-
| On selection or deselection of a file, an event is fired | P0 ||
13
+
| Retrieve files based on specified insight type| P0 ||
14
+
| Use `mgt-file` components to render each file inside of the drop down | P0 ||
15
+
| On selection of a file, a `selectionChanged` event is fired | P0 ||
15
16
| The selected file object(s) is accessible by the developer for further action |P0 ||
16
-
| Ability for developer to toggle between single-select and multiselect | P1 ||
17
-
| Visual indication of selected files | P2 | Will not be included in v1. |
18
-
| Render the selected files | P2 | Will not be included in v1. We will provide a sample for developers to render selected files using `mgt-file` components themselves. |
19
-
| Extended file picker is launched when “See all” is clicked | P2 | Not included in v1. |
17
+
| Extended file picker is launched when “See all” is clicked | P0 ||
18
+
|**v2**|||
19
+
| Retrieve files from a specified insight type or from a specific drive location based on identifiers provided by developer | P1 ||
20
+
| Ability for developer to toggle between single-select and multiselect | P1 ||
21
+
| Visual indication of selected files | P2 ||
22
+
| Render the selected files | P2 ||
20
23
21
24
## Proposed Solution
22
25
23
-
### Example 1: Show the user's top 10 most recently used files to select from
26
+
### Example 1 (v1): Show the user's top 10 most recently used files to select from
|`file-list-query`|`fileListQuery`| The full query or path to the folder in a drive or site to retrieve the list of files from |
34
-
|`file-queries`|`fileQueries`| An array of file queries to be rendered by the component |
36
+
|**v1**|||
35
37
|`files`|`files`| An array of files to get or set the list of files rendered by the component. Use this to access the files loaded by the component. Set this value to load your own files. |
36
38
|`insight-type`|`insightType`| Set to show the user’s trending, used, or shared files. |
39
+
|`show-max`|`showMax`| A number value to indicate the maximum number of files to show. |
40
+
|**v2**|||
41
+
|`file-list-query`|`fileListQuery`| The full query or path to the folder in a drive or site to retrieve the list of files from |
42
+
|`file-queries`|`fileQueries`| An array of file queries to be rendered by the component |
37
43
|`drive-id`|`driveId`| Id of the drive the folder belongs to. Must also provide either `item-id` or `item-path`. |
38
44
|`group-id `|`groupId`| Id of the group the folder belongs to. Must also provide either `item-id` or `item-path`. |
39
45
|`site-id`|`siteId`| Id of the site the folder belongs to. Must also provide either `{item-id}` or `{item-path}`. Provide `{list-id}` if you’re referencing a file from a list. |
40
46
|`item-id`|`itemId`| Id of the folder. Default query is `/me/drive/items`. Provide `{drive-id}`, `{group-id}`, `{site-id}`, or `{user-id}` to query a specific location. |
41
47
|`item-path`|`itemPath`| Item path of the folder. Default query is `/me/drive/root`. Provide `{drive-id}`, `{group-id}`, `{site-id}`, or `{user-id}` to query a specific location. |
42
-
|`show-max`|`showMax`| A number value to indicate the maximum number of files to show. |
43
-
|`selected-files`|`selectedFiles`| An array of selected file objects. |
44
48
|`multiselect`|`multiselect`| Enable/Disable selection of more than 1 file. Default is `false`.|
45
49
46
50
## Events
47
51
48
52
| Event | Description |
49
53
| ----- | ----------- |
50
-
|selectionChanged | Fired when the user selects or deselects a file |
54
+
| filesSelected | Fired when the user selects a file |
51
55
52
56
## APIs and Permission
53
57
54
-
Same as [mgt-file-list](./mgt-file-list.md).
58
+
| Query | Use if | Permission Scopes |
59
+
| ----- | ------ | ----------------- |
60
+
|**v1**|||
61
+
|`GET /me/insights/trending`|`insight-type` is trending | Sites.Read.All |
62
+
|`GET /me/insights/used`|`insight-type` is `used`| " |
63
+
|`GET /me/insights/shared`|`insight-type` is shared | " |
64
+
|**v2**|||
65
+
|`GET /me/drive/root/children`| Default (no identifiers or query provided) | Files.Read, Files.Read.All, Sites.Read.All |
66
+
|`GET /drives/{drive-id}/items/{item-id}/children`|`{drive-id}` AND `{item-id}`| " |
67
+
|`GET /groups/{group-id}/drive/items/{item-id}/children`|`{group-id}` AND `{item-id}`| " |
68
+
|`GET /me/drive/items/{item-id}/children`| ONLY `{item-id}`| " |
69
+
|`GET /sites/{site-id}/drive/items/{item-id}/children`|`{site-id}` AND `{item-id}`| " |
70
+
|`GET /users/{user-id}/drive/items/{item-id}/children`|`{user-id}` AND `{item-id}`| " |
71
+
|`GET /drives/{drive-id}/root:/{path-relative-to-root}:/children`|`{drive-id}` AND `{path-relative-to-root}`| " |
55
72
56
73
## Templates
57
74
@@ -60,5 +77,6 @@ Same as [mgt-file-list](./mgt-file-list.md).
60
77
| default | null: no data | The template used to override the rendering of the entire component |
61
78
| loading | null: no data | The template used to render the state of the picker while the request to Graph is being made. |
62
79
| error | null: no data | The template used if no files are returned |
63
-
| selected-file | file: the file details object | The template to render selected files |
64
-
| file | file: the file details object | The template to render files in the dropdown |
80
+
| file | file: the file details object | The template to render files in the dropdown |
81
+
| button | null: no data | The template used to override the default button that opens the picker |
82
+
| header | null: no data | The template used to override the header (text and "See All" button) displayed in the picker |
0 commit comments