Skip to content

Commit 0f94ef5

Browse files
author
Piotr Siatka
committed
Add comments. Add itemsCountQueryLimit parameter.
1 parent e6fea5e commit 0f94ef5

File tree

2 files changed

+51
-8
lines changed

2 files changed

+51
-8
lines changed

src/controls/filePicker/FilePicker.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export class FilePicker extends React.Component<IFilePickerProps, IFilePickerSta
3737
super(props);
3838

3939
// Initialize file browser services
40-
this.fileBrowserService = new FileBrowserService(props.webPartContext);
41-
this.oneDriveService = new OneDriveService(props.webPartContext);
42-
this.orgAssetsService = new OrgAssetsService(props.webPartContext);
40+
this.fileBrowserService = new FileBrowserService(props.webPartContext, this.props.itemsCountQueryLimit);
41+
this.oneDriveService = new OneDriveService(props.webPartContext, this.props.itemsCountQueryLimit);
42+
this.orgAssetsService = new OrgAssetsService(props.webPartContext, this.props.itemsCountQueryLimit);
4343
this.fileSearchService = new FilesSearchService(props.webPartContext, this.props.bingAPIKey);
4444

4545
this.state = {

src/controls/filePicker/IFilePickerProps.ts

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,73 @@ export interface IFilePickerProps {
2121
*/
2222
onSave:(filePickerResult: IFilePickerResult)=>void;
2323

24+
/**
25+
* Handler when file has been changed.
26+
*/
27+
onChanged: (filePickerResult: IFilePickerResult) => void;
28+
29+
/**
30+
* Current context.
31+
*/
32+
webPartContext: WebPartContext;
33+
2434
/**
2535
* File extensions to be displayed.
2636
*/
2737
accepts?: string;
2838

2939
/**
30-
* Used to execute WebSearch.
40+
* Sets the label to inform that the value is required.
41+
*/
42+
required?: boolean;
43+
44+
/**
45+
* Used to execute WebSearch. If not provided SearchTab will not be available.
3146
*/
3247
bingAPIKey?: string;
3348

34-
webPartContext: WebPartContext;
3549
/**
3650
* Specifies if the picker button is disabled
3751
*/
3852
disabled?: boolean;
3953

54+
/**
55+
* Number of itmes to obtain when executing REST queries. Default 100.
56+
*/
57+
itemsCountQueryLimit?: number;
58+
59+
/**
60+
* Specifies if RecentTab should be hidden.
61+
*/
4062
hideRecentTab?: boolean;
63+
64+
/**
65+
* Specifies if WebSearchTab should be hidden.
66+
*/
4167
hideWebSearchTab?: boolean;
68+
69+
/**
70+
* Specifies if OrganisationalAssetTab should be hidden.
71+
*/
4272
hideOrganisationalAssetTab?: boolean;
73+
74+
/**
75+
* Specifies if OneDriveTab should be hidden.
76+
*/
4377
hideOneDriveTab?: boolean;
78+
79+
/**
80+
* Specifies if SiteFilesTab should be hidden.
81+
*/
4482
hideSiteFilesTab?: boolean;
83+
84+
/**
85+
* Specifies if LocalUploadTab should be hidden.
86+
*/
4587
hideLocalUploadTab?: boolean;
46-
hideLinkUploadTab?: boolean;
4788

48-
required?: boolean;
49-
onChanged: (filePickerResult: IFilePickerResult) => void;
89+
/**
90+
* Specifies if LinkUploadTab should be hidden.
91+
*/
92+
hideLinkUploadTab?: boolean;
5093
}

0 commit comments

Comments
 (0)