-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1045 from pnp/dev
Merge for 3.4.0 release
- Loading branch information
Showing
85 changed files
with
11,885 additions
and
8,879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.45 KB
docs/documentation/docs/assets/modernTaxonomyPicker-input-autocomplete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.61 KB
docs/documentation/docs/assets/modernTaxonomyPicker-selected-terms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.2 KB
docs/documentation/docs/assets/modernTaxonomyPicker-tree-selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Modern Taxonomy Picker | ||
|
||
This control allows you to select one or more Terms from a TermSet via its TermSet ID. You can also configure the control to select the child terms from a specific term in the TermSet by setting the anchorTermId. This is the modern version of the taxonomy picker that uses the REST API and makes use of some load on demand features which makes it well suited for large term sets. | ||
|
||
!!! note "Disclaimer" | ||
Since this control is meant to look as and work in the same way as the out-of-the-box control it lacks some of the features from the legacy ```TaxonomyPicker``` control. If you need some of those features please continue using the legacy version. | ||
|
||
**Empty term picker** | ||
|
||
![Empty term picker](../assets/modernTaxonomyPicker-empty.png) | ||
|
||
**Selecting terms** | ||
|
||
![Selecting terms](../assets/modernTaxonomyPicker-tree-selection.png) | ||
|
||
**Selected terms in picker** | ||
|
||
![Selected terms in the input](../assets/modernTaxonomyPicker-selected-terms.png) | ||
|
||
**Term picker: Auto Complete** | ||
|
||
![Selected terms in the input](../assets/modernTaxonomyPicker-input-autocomplete.png) | ||
|
||
|
||
## How to use this control in your solutions | ||
|
||
- 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. | ||
- Import the following modules to your component: | ||
|
||
```TypeScript | ||
import { ModernTaxonomyPicker } from "@pnp/spfx-controls-react/lib/ModernTaxonomyPicker"; | ||
``` | ||
|
||
- Use the `ModernTaxonomyPicker` control in your code as follows: | ||
|
||
```TypeScript | ||
<ModernTaxonomyPicker allowMultipleSelections={true} | ||
termSetId="f233d4b7-68fb-41ef-8b58-2af0bafc0d38" | ||
panelTitle="Select Term" | ||
label="Taxonomy Picker" | ||
context={this.props.context} | ||
onChange={this.onTaxPickerChange} /> | ||
``` | ||
|
||
- With the `onChange` property you can capture the event of when the terms in the picker has changed: | ||
|
||
```typescript | ||
private onTaxPickerChange(terms : ITermInfo[]) { | ||
console.log("Terms", terms); | ||
} | ||
``` | ||
|
||
## Implementation | ||
|
||
The ModernTaxonomyPicker control can be configured with the following properties: | ||
|
||
| Property | Type | Required | Description | | ||
| ---- | ---- | ---- | ---- | | ||
| panelTitle | string | yes | TermSet Picker Panel title. | | ||
| label | string | yes | Text displayed above the Taxonomy Picker. | | ||
| disabled | boolean | no | Specify if the control should be disabled. Default value is false. | | ||
| context | BaseComponentContext | yes | Context of the current web part or extension. | | ||
| initialValues | ITermInfo[] | no | Defines the terms selected by default. ITermInfo comes from PnP/PnPjs and can be imported with <br/>```import { ITermInfo } from '@pnp/sp/taxonomy';``` | | ||
| allowMultipleSelections | boolean | no | Defines if the user can select only one or multiple terms. Default value is false. | | ||
| termSetId | string | yes | The Id of the TermSet that you would like the Taxonomy Picker to select terms from. | | ||
| onChange | function | no | Captures the event of when the terms in the picker has changed. | | ||
| anchorTermId | string | no | Set the id of a child term in the TermSet to be able to select terms from that level and below. | | ||
| placeHolder | string | no | Short text hint to display in picker. | | ||
| required | boolean | no | Specifies if to display an asterisk near the label. Default value is false. | | ||
| customPanelWidth | number | no | Custom panel width in pixels. | | ||
| termPickerProps | IModernTermPickerProps | no | Custom properties for the term picker (More info: [IBasePickerProps interface](https://developer.microsoft.com/en-us/fluentui#/controls/web/pickers#IBasePickerProps)). | | ||
| themeVariant | IReadonlyTheme | no | The current loaded SharePoint theme/section background (More info: [Supporting section backgrounds](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/supporting-section-backgrounds)). | | ||
|
||
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/TaxonomyPicker) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './controls/modernTaxonomyPicker'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const version: string = "3.3.0"; | ||
export const version: string = "3.4.0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.