Skip to content

Commit 302f94f

Browse files
Merge branch 'dev' into Feature/DragDropFileDocUpdateV3
2 parents 1991aed + 63b2d42 commit 302f94f

30 files changed

+1038
-90
lines changed

CHANGELOG.JSON

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,28 @@
55
"changes": {
66
"new": [
77
"`TeamPicker`: new Team Picker control [#846](https://github.com/pnp/sp-dev-fx-controls-react/pull/846)",
8-
"`TeamChannelPicker`: new Team Channel Picker control [#846](https://github.com/pnp/sp-dev-fx-controls-react/pull/846)"
8+
"`TeamChannelPicker`: new Team Channel Picker control [#846](https://github.com/pnp/sp-dev-fx-controls-react/pull/846)",
9+
"`SitePicker`: new Site Picker control [#868](https://github.com/pnp/sp-dev-fx-controls-react/pull/868)",
10+
"`DocumentLibraryBrowser`, `SiteFilePickerTab`: jest unit tests [#866](https://github.com/pnp/sp-dev-fx-controls-react/pull/866) "
911
],
1012
"enhancements": [],
1113
"fixes": [
1214
"Documentation for `ListView`: typos fixes [#855](https://github.com/pnp/sp-dev-fx-controls-react/pull/855)",
1315
"Documentation fix: type on index page [#852](https://github.com/pnp/sp-dev-fx-controls-react/pull/852)",
14-
"`PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)"
16+
"`PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)",
17+
"`TreeView`: Not able to select/deselect checkbox in spfx-controls-react TreeView after assign the defaultSelectedKeys value [#870](https://github.com/pnp/sp-dev-fx-controls-react/issues/870)",
18+
"`FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)",
19+
"`ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)"
1520
]
1621
},
1722
"contributions": [
1823
"[Ari Gunawan](https://github.com/AriGunawan)",
1924
"[aroraans1512](https://github.com/aroraans1512)",
20-
"[joaojmendes](https://github.com/joaojmendes)"
25+
"[cwparsons](https://github.com/cwparsons)",
26+
"[joaojmendes](https://github.com/joaojmendes)",
27+
"[Kunj Balkrishna Sangani](https://github.com/kunj-sangani)",
28+
"[Marcin Wojciechowski](https://github.com/mgwojciech)",
29+
"[Yannick Reekmans](https://github.com/YannickRe)"
2130
]
2231
},
2332
{

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Releases
22

3+
## 3.1.0
4+
5+
### New control(s)
6+
7+
- `TeamPicker`: new Team Picker control [#846](https://github.com/pnp/sp-dev-fx-controls-react/pull/846)
8+
- `TeamChannelPicker`: new Team Channel Picker control [#846](https://github.com/pnp/sp-dev-fx-controls-react/pull/846)
9+
- `SitePicker`: new Site Picker control [#868](https://github.com/pnp/sp-dev-fx-controls-react/pull/868)
10+
11+
### Fixes
12+
13+
- Documentation for `ListView`: typos fixes [#855](https://github.com/pnp/sp-dev-fx-controls-react/pull/855)
14+
- Documentation fix: type on index page [#852](https://github.com/pnp/sp-dev-fx-controls-react/pull/852)
15+
- `PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)
16+
17+
### Contributors
18+
19+
Special thanks to our contributors (in alphabetical order): [Ari Gunawan](https://github.com/AriGunawan), [aroraans1512](https://github.com/aroraans1512), [joaojmendes](https://github.com/joaojmendes).
20+
321
## 3.0.0
422

523
### Enhancements

docs/documentation/docs/about/release-notes.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Releases
22

3+
## 3.1.0
4+
5+
### New control(s)
6+
7+
- `TeamPicker`: new Team Picker control [#846](https://github.com/pnp/sp-dev-fx-controls-react/pull/846)
8+
- `TeamChannelPicker`: new Team Channel Picker control [#846](https://github.com/pnp/sp-dev-fx-controls-react/pull/846)
9+
- `SitePicker`: new Site Picker control [#868](https://github.com/pnp/sp-dev-fx-controls-react/pull/868)
10+
11+
### Fixes
12+
13+
- Documentation for `ListView`: typos fixes [#855](https://github.com/pnp/sp-dev-fx-controls-react/pull/855)
14+
- Documentation fix: type on index page [#852](https://github.com/pnp/sp-dev-fx-controls-react/pull/852)
15+
- `PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)
16+
17+
### Contributors
18+
19+
Special thanks to our contributors (in alphabetical order): [Ari Gunawan](https://github.com/AriGunawan), [aroraans1512](https://github.com/aroraans1512), [joaojmendes](https://github.com/joaojmendes).
20+
321
## 3.0.0
422

523
### Enhancements
1.76 MB
Loading
1.71 MB
Loading
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# SitePicker control
2+
3+
This control allows you to select one or multiple available sites, site collections or hub sites.
4+
5+
Here is an example of the control.
6+
7+
`SitePicker` single selection mode:
8+
9+
![SitePicker Single Select](../assets/site-picker-single-select.gif)
10+
11+
`SitePicker` multi-selection mode
12+
13+
![SitePicker Multi Select](../assets/site-picker-multi-select.gif)
14+
15+
## How to use this control in your solutions
16+
17+
- 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.
18+
- Import the control into your component:
19+
20+
```TypeScript
21+
import { SitePicker } from "@pnp/spfx-controls-react/lib/SitePicker";
22+
```
23+
24+
- Use the `SitePicker` control in your code as follows:
25+
26+
```TypeScript
27+
<SitePicker
28+
context={this.props.context}
29+
label={'Select sites'}
30+
mode={'site'}
31+
allowSearch={true}
32+
multiSelect={false}
33+
onChange={(sites) => { console.log(sites); }}
34+
placeholder={'Select sites'}
35+
searchPlaceholder={'Filter sites'} />
36+
```
37+
38+
- The `onChange` change event returns the selected site(s).
39+
40+
## Implementation
41+
42+
The `SitePicker` control can be configured with the following properties:
43+
44+
| Property | Type | Required | Description |
45+
| ---- | ---- | ---- | ---- |
46+
| allowSearch | boolean | no | Specifies if search box is displayed for the component. Default: `true`. |
47+
| context | BaseComponentContext | yes | The context object of the SPFx loaded webpart or customizer. |
48+
| deferredSearchTime | number | no | The list will be filtered after users stop typing for `deferredSearchTime` milliseconds. Default: 200. |
49+
| className | string | no | If provided, additional class name to provide on the dropdown element. |
50+
| disabled | boolean | no | Whether or not the control is disabled. |
51+
| initialSites | ISite[] | no | Intial data to load in the 'Selected sites' area (optional). |
52+
| isDesc | boolean | no | Specifies if the list is sorted in descending order. Default: `false`. |
53+
| label | string | no | Label to use for the control. |
54+
| limitToCurrentSiteCollection | boolean | no | Specifies if the options should be limited by the current site collections. Taken into consideration if selectionMode is set to `web`. |
55+
| mode | `'site' \| 'web' \| 'hub'` | no | Defines what entities are available for selection: site collections, sites, hub sites. Default: `web`. |
56+
| multiSelect | boolean | no | Optional mode indicates if multi-choice selections is allowed. Default: `true`. |
57+
| onChange | `(selectedSites: ISite[]) => void` | yes | Selection change handler. |
58+
| orderBy | `'title' \| 'url'` | no | Specifices if the list is sorted by title or url. Default: `title`. |
59+
| placeholder | string | no | Placeholder label to show in the dropdown. |
60+
| searchPlaceholder | string | no | Search input placeholder text. Displayed until search text is entered. |
61+
62+
Interface `ISite`
63+
64+
| Property | Type | Required | Description |
65+
| ---- | ---- | ---- | ---- |
66+
| id | string | no | ID of the site collection. |
67+
| title | string | no | Title of the site. |
68+
| url | string | no | URL of the site. |
69+
| webId | string | no | ID of the site. **Note: the value is not populated if the `mode` is set to `hub`. |
70+
| hubSiteId | string | no | ID of the hub site. |
71+
72+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/SitePicker)

docs/documentation/docs/controls/TreeView.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { TreeView, ITreeItem, TreeViewSelectionMode } from "@pnp/spfx-controls-r
3434
items={treeitems}
3535
defaultExpanded={false}
3636
selectionMode={TreeViewSelectionMode.Multiple}
37-
selectChildrenIfParentSelected={true}
37+
selectChildrenMode={SelectChildrenMode.Select | SelectChildrenMode.Unselect}
3838
showCheckboxes={true}
3939
treeItemActionsDisplayMode={TreeItemActionsDisplayMode.ContextualMenu}
4040
defaultSelectedKeys={['key1', 'key2']}
@@ -91,7 +91,8 @@ The `TreeView` control can be configured with the following properties:
9191
| items | ITreeItem[] | yes | An array of tree items to display. refer [example](#example-of-array-of-tree-items-used-to-render-control-as-in-first-screenshot). |
9292
| defaultExpanded | boolean | no | Specify if the tree items are displayed as expanded by default (defaults to false. |
9393
| selectionMode | enum | no | Specifies the selection mode of tree view (defaults to Single selection). |
94-
| selectChildrenIfParentSelected | boolean | no | Specifies if the childrens should be selected when parent item is selected (defaults to false). |
94+
| selectChildrenIfParentSelected | boolean | no | Specifies if the children should be selected when parent item is selected (defaults to false). __Deprecated__: prefer usage of `selectChildrenMode` for more flexibility. |
95+
| selectChildrenMode | SelectChildrenMode | no | Specifies if the children should be selected when parent item is selected (defaults to None). Flagged enum, values can be combined eg. `SelectChildrenMode.Select \| SelectChildrenMode.Unselect` |
9596
| showCheckboxes | boolean | yes | Specify if the checkboxes should be displayed for selection. |
9697
| treeItemActionsDisplayMode | TreeItemActionsDisplayMode | no | Specifies the display mode of the tree item actions. |
9798
| defaultSelectedKeys | string[] | no | Specifies keys of items to be selected by default. |
@@ -111,6 +112,19 @@ Specifies the selection mode of tree item.
111112
| Multiple |
112113
| None |
113114
115+
Enum `SelectChildrenMode`
116+
117+
Specifies when the children of a selected item need to be automatically selected.
118+
119+
| Value | Description |
120+
|----------|------------------------------------------------------------------|
121+
| None | Children are never selected |
122+
| Select | When selecting an item, its children are also selected |
123+
| Unselect | When unselecting an item, its children are also unselected |
124+
| Mount | When the component is mounted, all children of selected items are also selected |
125+
| Update | When the component receives new props, all children of selected items are also selected |
126+
| All | Shorthand for a combination of all of the above, same as `SelectChildrenMode.Select \| SelectChildrenMode.Unselect \| SelectChildrenMode.Mount \| SelectChildrenMode.Update` | |
127+
114128
Interface `ITreeItem`
115129
116130
Each tree item in the `treeitems` property is defined as `ITreeItem` as follows:

docs/documentation/docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ The following controls are currently available:
8383
- [PeoplePicker](./controls/PeoplePicker) (People Picker)
8484
- [Placeholder](./controls/Placeholder) (shows an initial placeholder if the web part has to be configured)
8585
- [Progress](./controls/Progress) (shows progress of multiple SEQUENTIALLY executed actions)
86-
- [SiteBreadcrumb](./controls/SiteBreadcrumb) (Breadcrumb control)
8786
- [SecurityTrimmedControl](./controls/SecurityTrimmedControl) (intended to be used when you want to show or hide components based on the user permissions)
87+
- [SiteBreadcrumb](./controls/SiteBreadcrumb) (Breadcrumb control)
88+
- [SitePicker](./controls/SitePicker) (Site Picker control)
8889
- [TaxonomyPicker](./controls/TaxonomyPicker) (Taxonomy Picker)
8990
- [TeamChannelPicker](./controls/TeamChannelPicker) (Team Channel Picker)
9091
- [TeamPicker](./controls/TeamPicker) (Team Picker)

docs/documentation/mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ nav:
4747
- Placeholder: 'controls/Placeholder.md'
4848
- Progress: 'controls/Progress.md'
4949
- RichText: 'controls/RichText.md'
50-
- SiteBreadcrumb: 'controls/SiteBreadcrumb.md'
5150
- SecurityTrimmedControl: 'controls/SecurityTrimmedControl.md'
51+
- SiteBreadcrumb: 'controls/SiteBreadcrumb.md'
52+
- SitePicker: 'controls/SitePicker.md'
5253
- TaxonomyPicker: 'controls/TaxonomyPicker.md'
5354
- TeamChannelPicker: 'controls/TeamChannelPicker.md'
5455
- TeamPicker: 'controls/TeamPicker.md'

0 commit comments

Comments
 (0)