Skip to content

Commit 0d423e7

Browse files
Merge branch 'dev' into Add-Component-ListItemComments
2 parents fb902dd + ce9d6e6 commit 0d423e7

Some content is hidden

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

59 files changed

+862
-35
lines changed

CHANGELOG.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@
44
"version": "3.16.0",
55
"changes": {
66
"new": [
7+
"`ViewPicker`: new control ViewPicker [#1439](https://github.com/pnp/sp-dev-fx-controls-react/issues/1439)"
78
],
89
"enhancements": [
10+
"`FieldCollectionData`: render on page instead of panel and added combobox and peoplepicker controls [#1588](https://github.com/pnp/sp-dev-fx-controls-react/pull/1588)"
911
],
1012
"fixes": [
13+
"`AccessibleAccordion`: fix typo in documentation [#1634](https://github.com/pnp/sp-dev-fx-controls-react/pull/1634)",
14+
"`DynamicForm`: fix issue with MultiChoice field [#1510](https://github.com/pnp/sp-dev-fx-controls-react/issues/1510)",
15+
"`Localization`: Update dutch translations [#1635](https://github.com/pnp/sp-dev-fx-controls-react/issues/1635)",
16+
"`TaxonomyPicker`: suggested item contains double termset name [#1597](https://github.com/pnp/sp-dev-fx-controls-react/issues/1597)"
1117
]
1218
},
1319
"contributions": [
20+
"[Guido Zambarda](https://github.com/GuidoZam)",
21+
"[Nils Andresen](https://github.com/nils-a)",
22+
"[Nishkalank Bezawada](https://github.com/NishkalankBezawada)",
23+
"[Rico van de Ven](https://github.com/RicoNL)",
24+
"[wuxiaojun514](https://github.com/wuxiaojun514)",
1425
]
1526
},
1627
{
30.2 KB
Loading
14.8 KB
Loading
31.5 KB
Loading

docs/documentation/docs/controls/AdaptiveCardDesignerHost.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ Here is an example of the control in action inside a Web Part:
3030
* 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.
3131

3232
* In your component file, import the `AdaptiveCardDesignerHost` control as follows:
33+
3334
```Typescript
3435
import { AdaptiveCardDesignerHost, HostContainer, BindingPreviewMode, Versions } from "@pnp/spfx-controls-react/lib/AdaptiveCardDesignerHost";
3536
```
3637

3738
- Example on use the `AdaptiveCardDesignerHost` control with only required properties:
39+
3840
```Typescript
3941
<AdaptiveCardDesignerHost
4042
headerText="Adaptive Card Designer"
@@ -45,6 +47,7 @@ import { AdaptiveCardDesignerHost, HostContainer, BindingPreviewMode, Versions }
4547
```
4648

4749
- Example on use the `AdaptiveCardDesignerHost` control with all properties:
50+
4851
```Typescript
4952
<AdaptiveCardDesignerHost
5053
headerText="Adaptive Card Designer"
@@ -72,6 +75,7 @@ import { AdaptiveCardDesignerHost, HostContainer, BindingPreviewMode, Versions }
7275
snippets={snippets}
7376
/>
7477
```
78+
7579
## Implementation
7680

7781
The `AdaptiveCardDesignerHost` control can be configured with the following properties:

docs/documentation/docs/controls/FieldCollectionData.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The `FieldCollectionData` control can be configured with the following propertie
9696
| saveAndAddBtnLabel | string | yes | Label of the save and add button. | |
9797
| cancelBtnLabel | string | yes | Label of the cancel button. | |
9898
| fields | ICustomCollectionField[] | yes | The fields to be used for the list of collection data. | |
99-
| value | string | yes | The collection data value. | |
99+
| value | any[] | yes | The collection data value. | |
100100
| enableSorting | boolean | no | Specify if you want to be able to sort the items in the collection. | false |
101101
| disabled | boolean | no | Specify if the control is disabled. | false |
102102
| disableItemCreation | boolean | no | Allows you to specify if user can create new items. | false |
@@ -106,6 +106,9 @@ The `FieldCollectionData` control can be configured with the following propertie
106106
| itemsPerPage | number | no | Allows you to specify the amount of items displayed per page. Paging control is added automatically. | |
107107
| executeFiltering | (searchFilter: string, item: any) => boolean | no | Allows you to show Search Box and specify own filtering logic. | |
108108
| panelProps | IPanelProps | no | Allows you to pass in props of the panel such as type and customWidth to control the underlying panel. | |
109+
| context | BaseComponentContext | no | Needed if **peoplepicker** field type is used | |
110+
| usePanel | boolean | no | Specify if you want the control to opened in a panel or directly on the page (only useful within webpart) | true |
111+
| noDataMessage | string | no | Specify the message when no items are added to the collection ||
109112

110113
Interface `ICustomCollectionField`
111114

@@ -116,13 +119,18 @@ Interface `ICustomCollectionField`
116119
| type | CustomCollectionFieldType | yes | Specifies the type of field to render. |
117120
| disableEdit | boolean | no | Allows you to specify if a field is disabled for editing. |
118121
| required | boolean | no | Specify if the field is required. |
119-
| options | [IDropdownOption[]](https://developer.microsoft.com/en-us/fabric#/components/dropdown) | no | Dropdown options. Only necessary when dropdown type is used. |
122+
| options | [IDropdownOption[]](https://developer.microsoft.com/en-us/fabric#/components/dropdown) [IComboboxOption[]](https://developer.microsoft.com/en-us/fluentui#/controls/web/combobox) | no | Dropdown options. Only necessary when dropdown or combobox type is used. |
120123
| onRenderOption | IRenderFunction<ISelectableOption> | no | Dropdown custom options render method. Only for the **dropdown** field type. |
121124
| placeholder | string | no | Placehoder text which will be used for the input field. If not provided the input title will be used. |
122125
| defaultValue | any | no | Specify a default value for the input field. |
123126
| deferredValidationTime | number | no | Field will start to validate after users stop typing for `deferredValidationTime` milliseconds. Default: 200ms. |
124127
| onGetErrorMessage | (value: any, index: number, crntItem: any): string \| Promise<string> | no | The method is used to get the validation error message and determine whether the input value is valid or not. It provides you the current row index and the item you are currently editing. |
125128
| onCustomRender | (field: ICustomCollectionField, value: any, onUpdate: (fieldId: string, value: any) => void, item: any, itemUniqueId: string, onCustomFieldValidation: (fieldId: string, errorMessage: string) => void) => JSX.Element | no | This property is only required if you are using the `custom` field type and it can be used to specify the custom rendering of your control in the collection data. |
129+
| multiSelect | boolean| no | Specifies multiple options can be selected (**combobox**) or mutliple users can be selected (**peoplepicker**) |
130+
| allowFreeform | boolean | no | Specifies that own options can be entered. Only for **combobox** field type |
131+
| minimumUsers| number | no | Specifies the minimum number of users to be entered for **peoplepicker** field type |
132+
| minimumUsersMessage| string | no | Specifies the message to be displayed if minimumUsers are not entered for **peoplepicker** field type |
133+
| maximumUsers | number | no | Specifies the maximum number of users to be entered for **peoplepicker** field type |
126134

127135
Enum `CustomCollectionFieldType`
128136

@@ -132,8 +140,10 @@ Enum `CustomCollectionFieldType`
132140
| number | Number field |
133141
| boolean | Checkbox |
134142
| dropdown | Dropdown field. You will have to specify the `options` property when using this field type |
143+
| combobox | Combobox field. You wil have to specify the `options` property, optional specify `allowFreeform` and `multiSelect` |
135144
| fabricIcon | Name of the [Office UI Fabric icon](https://developer.microsoft.com/en-us/fabric#/styles/icons) |
136145
| url | URL field |
146+
| peoplepicker | Peoplepicker control |
137147
| custom | This gives you control over the whole field rendering. Be sure to provide the `onCustomRender` method to render your control in the collection data. |
138148

139149
![](https://telemetry.sharepointpnp.com/sp-dev-fx-property-controls/wiki/FieldCollectionData)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# ViewPicker control
2+
3+
This control allows you to select available views from lists/libraries of the current site.
4+
5+
Here is an example of the control:
6+
7+
![ViewPicker initial](../assets/ViewPicker1.PNG)
8+
9+
`ViewPicker` single selection mode:
10+
11+
![ViewPicker single selection](../assets/ViewPicker2.png)
12+
13+
`ViewPicker` multi selection mode:
14+
15+
![ViewPicker multi selection](../assets/ViewPicker-multi.png)
16+
17+
18+
## How to use this control in your solutions
19+
20+
- 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.
21+
- Import the control into your component:
22+
23+
24+
```TypeScript
25+
import { ViewPicker } from "@pnp/spfx-controls-react/lib/ViewPicker";
26+
```
27+
28+
- Use the `ViewPicker` control in your code as follows:
29+
30+
```TypeScript
31+
<ViewPicker context={this.props.context}
32+
listId={"9f3908cd-1e88-4ab3-ac42-08efbbd64ec9"}
33+
placeholder={'Select list view(s)'}
34+
orderBy={orderBy.Title}
35+
multiSelect={true}
36+
onSelectionChanged={this.onViewPickerChange} />
37+
```
38+
39+
- The `onSelectionChanged` change event returns the selected view(s) and can be implemented as follows in your webpart:
40+
41+
```TypeScript
42+
private onViewPickerChange = (views: string | string[]) => {
43+
console.log("Views:", views);
44+
}
45+
```
46+
47+
48+
## Implementation
49+
50+
The `ViewPicker` control can be configured with the following properties
51+
52+
| Property | Type | Required | Description |
53+
| ---- | ---- | ---- | ---- |
54+
| context | BaseComponentContext | yes | The context object of the SPFx loaded webpart or customizer. |
55+
| className | string | no | If provided, additional class name to provide on the dropdown element. |
56+
| disabled | boolean | no | Whether or not the view picker control is disabled. |
57+
| filter | string | no | Filter views from Odata query. |
58+
| label | string | no | Label to use for the control. |
59+
| listId | string | no | The List Id of the list. |
60+
| placeholder | string | no | Placeholder label to show in the dropdown. |
61+
| orderBy | Enum | no | How to order the set of views (By ID or Title). |
62+
| selectedView | string OR string[] | no | Keys(View Ids) of the selected item(s). If you provide this, you must maintain selection state by observing onSelectionChanged events and passing a new value in when changed. |
63+
| multiSelect | boolean | no | Optional mode indicates if multi-choice selections is allowed. Default to `false`. |
64+
| showBlankOption | boolean | no | Whether or not to show a blank option. Default to `false`. |
65+
| viewsToExclude | string[] | no | Defines view titles which should be excluded from the view picker control. |
66+
| webAbsoulteUrl | string | no | Absolute Web Url of target site (user requires permissions) |
67+
| onSelectionChanged | (newValue: string OR string[]): void | no | Callback function when the selected option changes. |
68+
69+
Enum `orderBy`
70+
71+
| Value |
72+
| ---- |
73+
| Id |
74+
| Title |

docs/documentation/docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ telemetry.optOut();
6161

6262
The following controls are currently available:
6363

64-
- [AccessibleAccordion](./controls/AccessibleAccordion) (Control to render an accordion. React `AccessibleAccourdion`-based implementation)
64+
- [AccessibleAccordion](./controls/AccessibleAccordion) (Control to render an accordion. React `AccessibleAccordion`-based implementation)
6565
- [Accordion](./controls/Accordion) (Control to render an accordion)
6666
- [AdaptiveCardHost](./controls/AdaptiveCardHost.md) (Control to render Adaptive Cards)
6767
- [AdaptiveCardDesignerHost](./controls/AdaptiveCardDesignerHost.md) (Control to render Adaptive Cards Designer)

src/ViewPicker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './controls/viewPicker/index';

src/common/SPEntities.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,15 @@ export interface IUploadImageResult {
206206
ServerRelativeUrl: string;
207207
UniqueId: string;
208208
}
209+
210+
export interface ISPView {
211+
Id: string;
212+
Title: string;
213+
}
214+
215+
/**
216+
* Defines a collection of SharePoint list views
217+
*/
218+
export interface ISPViews {
219+
value: ISPView[];
220+
}

0 commit comments

Comments
 (0)