Skip to content

Commit efc96e8

Browse files
authored
Merge pull request #32 from SharePoint/dev
Merge 1.4.0 changes
2 parents c420d43 + ed61007 commit efc96e8

33 files changed

+589
-7
lines changed

CHANGELOG.md

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

3+
## 1.4.0
4+
5+
**New controls**
6+
7+
- `PropertyFieldMultiSelect` got added
8+
- `PropertyFieldNumber` got added
9+
10+
**Enhancements**
11+
12+
- `PropertyFieldTermPicker` new introduced property to specify to show or hide the term store name: `hideTermStoreName`.
13+
- `PropertyFieldTermPicker` updated process when terms were unselected based on ID instead of path.
14+
315
## 1.3.0
416

517
**New controls**

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

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

3+
## 1.4.0
4+
5+
**New controls**
6+
7+
- `PropertyFieldMultiSelect` got added
8+
- `PropertyFieldNumber` got added
9+
10+
**Enhancements**
11+
12+
- `PropertyFieldTermPicker` new introduced property to specify to show or hide the term store name: `hideTermStoreName`.
13+
- `PropertyFieldTermPicker` updated process when terms were unselected based on ID instead of path.
14+
315
## 1.3.0
416

517
**New controls**
982 KB
Loading
675 KB
Loading

docs/documentation/docs/beta.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Testing out a beta release ![](https://img.shields.io/npm/v/@pnp/spfx-property-controls/next.svg)
2+
3+
All you need to do for testing out a beta release of `@pnp/spfx-property-controls` is to install the dependency as follows:
4+
5+
```
6+
npm install @pnp/spfx-property-controls@next --save
7+
```
8+
9+
## Beta control documentation
10+
11+
The control documentation is only live for public releases, not for beta versions. If you want to checkout the markdown files of all controls in the `dev` branch: [beta documentation](https://github.com/SharePoint/sp-dev-fx-property-controls/tree/dev/docs/documentation/docs/controls).
12+
13+
## Next Steps
14+
15+
Once you installed the beta version, you can start using the controls in your solution. Go to the homepage to get an overview of all the available controls and the steps to get started: [home](./).
16+
17+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-property-controls/wiki/beta)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# PropertyFieldMultiSelect control
2+
3+
This control generates a dropdown with the possibility of selecting multiple values.
4+
5+
**Multi-select field rendering**
6+
7+
![Multi-select field](../assets/FieldMultiSelect.gif)
8+
9+
## How to use this control in your solutions
10+
11+
1. Check that you installed the `@pnp/spfx-property-controls` dependency. Check out The [getting started](../#getting-started) page for more information about installing the dependency.
12+
2. Import the following modules to your component:
13+
14+
```TypeScript
15+
import { PropertyFieldMultiSelect } from '@pnp/spfx-property-controls/lib/PropertyFieldMultiSelect';
16+
```
17+
18+
3. Create a new property for your web part, for example:
19+
20+
```TypeScript
21+
export interface IPropertyControlsTestWebPartProps {
22+
multiSelect: string[];
23+
}
24+
```
25+
26+
4. Add the custom property control to the `groupFields` of the web part property pane configuration:
27+
28+
```TypeScript
29+
PropertyFieldMultiSelect('multiSelect', {
30+
key: 'multiSelect',
31+
label: "Multi select field",
32+
options: [
33+
{
34+
key: "EN",
35+
text: "EN"
36+
},
37+
{
38+
key: "FR",
39+
text: "FR"
40+
},
41+
{
42+
key: "NL",
43+
text: "NL"
44+
}
45+
],
46+
selectedKeys: this.properties.multiSelect
47+
})
48+
```
49+
50+
## Implementation
51+
52+
The `PropertyFieldMultiSelect` control uses the same implementation as the default `PropertyPaneDropdown` control and has the following additional properties:
53+
54+
| Property | Type | Required | Description |
55+
| ---- | ---- | ---- | ---- |
56+
| selectedKeys | string[] OR number[] | no | Specifies the selected keys. |
57+
58+
> **Important**: Do not make use of the `selectedKey` property. This property is inherited from the `PropertyPaneDropdown` control.
59+
60+
61+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-property-controls/wiki/PropertyFieldMultiSelect)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# PropertyFieldNumber control
2+
3+
This control generates an input field for numbers. Text is not allowed as this will result into an invalid input.
4+
5+
**PropertyFieldNumber example usage**
6+
7+
![PropertyFieldNumber example](../assets/PropertyFieldNumber.gif)
8+
9+
## How to use this control in your solutions
10+
11+
1. Check that you installed the `@pnp/spfx-property-controls` dependency. Check out The [getting started](../#getting-started) page for more information about installing the dependency.
12+
2. Import the following modules to your component:
13+
14+
```TypeScript
15+
import { PropertyFieldNumber } from '@pnp/spfx-property-controls/lib/PropertyFieldNumber';
16+
```
17+
18+
3. Create a new property for your web part, for example:
19+
20+
```TypeScript
21+
export interface IPropertyControlsTestWebPartProps {
22+
numberValue: number;
23+
}
24+
```
25+
26+
4. Add the custom property control to the `groupFields` of the web part property pane configuration:
27+
28+
```TypeScript
29+
PropertyFieldNumber("numberValue", {
30+
key: "numberValue",
31+
label: "Number value only",
32+
description: "Number field description",
33+
value: this.properties.numberValue,
34+
maxValue: 10,
35+
minValue: 1,
36+
disabled: false
37+
})
38+
```
39+
40+
## Implementation
41+
42+
The `PropertyFieldNumber` control can be configured with the following properties:
43+
44+
| Property | Type | Required | Description |
45+
| ---- | ---- | ---- | ---- |
46+
| key | string | yes | An unique key that indicates the identity of this control. |
47+
| label | string | yes | Property field label displayed on top. |
48+
| description | string | no | The number field input description. |
49+
| placeholder | string | no | Placeholder text to be displayed in the number field. |
50+
| value | number | no | Value to be displayed in the number field. |
51+
| maxValue | number | no | Maximum number that can be inserted. |
52+
| minValue | number | no | Minimum number that can be inserted. |
53+
| disabled | boolean | no | Specify if the control needs to be disabled. |
54+
| errorMessage | string | no | If set, this will be displayed as an error message. |
55+
| deferredValidationTime | number | no | Number field will start to validate after users stop typing for `deferredValidationTime` milliseconds. |
56+
57+
58+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-property-controls/wiki/PropertyFieldNumber)

docs/documentation/docs/controls/PropertyFieldTermPicker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ The `PropertyFieldTermPicker` control can be configured with the following prope
7878
| excludeSystemGroup | boolean | no | Indicator to define if the system Groups are exclude. Default is false. |
7979
| limitByGroupNameOrID | string | no | Limit the term sets that can be used by the group name or ID. |
8080
| limitByTermsetNameOrID | string | no | Limit the terms that can be picked by the Term Set name or ID. |
81+
| hideTermStoreName | boolean | no | Specifies if you want to show or hide the term store name from the panel. |
8182
| onPropertyChange | function | yes | Defines a onPropertyChange function to raise when the date gets changed. |
8283
| properties | any | yes | Parent web part properties, this object is use to update the property value. |
8384
| key | string | yes | An unique key that indicates the identity of this control. |

docs/documentation/docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Reusable property pane controls for the SharePoint Framework solutions
1+
# Reusable property pane controls for the SharePoint Framework solutions ![](https://img.shields.io/npm/v/@pnp/spfx-property-controls.svg)
22

33
This repository provides developers with a set of reusable property pane controls that can be used in their SharePoint Framework (SPFx) solutions.
44

@@ -32,6 +32,7 @@ The following controls are currently available:
3232
- [PropertyFieldPeoplePicker](./controls/PropertyFieldPeoplePicker) (Property pane people / group selector)
3333
- [PropertyFieldSpinButton](./controls/PropertyFieldSpinButton) (Property pane spin button)
3434
- [PropertyFieldTermPicker](./controls/PropertyFieldTermPicker) (Property pane managed metadata term selector)
35+
- [PropertyFieldMultiSelect](./controls/PropertyFieldMultiSelect) (Property pane field which allows multi-value selection)
3536

3637
The following controls are extended controls that show a callout next to the label
3738

docs/documentation/mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pages:
88
- PropertyFieldPeoplePicker: 'controls/PropertyFieldPeoplePicker.md'
99
- PropertyFieldSpinButton: 'controls/PropertyFieldSpinButton.md'
1010
- PropertyFieldTermPicker: 'controls/PropertyFieldTermPicker.md'
11+
- PropertyFieldMultiSelect: 'controls/PropertyFieldMultiSelect.md'
1112
- 'Controls with callout':
1213
- PropertyFieldButtonWithCallout: 'controls/PropertyFieldButtonWithCallout.md'
1314
- PropertyFieldCheckboxWithCallout: 'controls/PropertyFieldCheckboxWithCallout.md'
@@ -18,6 +19,7 @@ pages:
1819
- PropertyFieldSliderWithCallout: 'controls/PropertyFieldSliderWithCallout.md'
1920
- PropertyFieldTextWithCallout: 'controls/PropertyFieldTextWithCallout.md'
2021
- PropertyFieldToggleWithCallout: 'controls/PropertyFieldToggleWithCallout.md'
22+
- 'Beta testing': 'beta.md'
2123
- About:
2224
- 'Release notes': 'about/release-notes.md'
2325
- License: 'about/license.md'

0 commit comments

Comments
 (0)