diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..b03eebae --- /dev/null +++ b/404.html @@ -0,0 +1,1050 @@ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +License
+MIT License
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ + + + + + + + + +PropertyFieldButton
: New Control PropertyFieldButton #613PropertyFieldGrid
: New Control PropertyFieldGrid #614fast-serve
: ast-serve update to match the most recent changes. #606PropertyFieldContentTypePicker
: PropertyFieldContentTypePicker control #611PropertyFieldFilePicker
: add a delete button to the selected file #579PropertyFieldFilePicker
: Fix root site org asset library showing no items in file picker (https://github.com/pnp/sp-dev-fx-property-controls/pull/603)PropertyFieldFolderPicker
: added siteAbsoluteUrl to FOlderPicker (https://github.com/pnp/sp-dev-fx-property-controls/pull/602)General Helper
: toRelativeUrl returns proper relative url in case of root site (https://github.com/pnp/sp-dev-fx-property-controls/pull/609)Special thanks to our contributors (in alphabetical order): Daniel Lindén, Jake, João Mendes, Nishkalank Bezawada, ramonitor, Russell gove, Sergei Sergeev.
+PropertyFieldSitePicker
: disabled property not implemented in UI #577PropertyFieldMonacoEditor
and PropertyFieldCodeEditor
: fix text selection in code editor #590Special thanks to our contributors (in alphabetical order): Luna Heyman, srpmtt.
+PropertyFieldChoiceGroupWithCallout
deletes properties #592Localization
: Errors in en-gb loc file #582Localization
: Errors in german language #589PropertyFieldFilePicker
: fix Tiles view #562Special thanks to our contributors (in alphabetical order): andrew-lott, Clem S-K, Tom F..
+PropertyFieldListPicker
: Implemented functionality to select multiple base templates #568fast-serve
: Fast-serve updated to the latest version and serve warnings fixed. #579Special thanks to our contributors (in alphabetical order): Chandani Prajapati, Sergei Sergeev.
+PropertyFieldCollectionData
: add panelProps
property to collection data #546PropertyPanePropertyEditor
: crash when property undefined/null #552Special thanks to our contributors (in alphabetical order): Chad Eiserloh, Gitwey, Jake Stanger, Luca3082, Valeras Narbutas.
+PropertyFieldFilePicker
: Site Tab - Adding scrolling for many libraries #525SPListPickerService
: add ContentTypes/Name to the query #521PropertyPaneHelpers
#536ColorPicker
: localization for Fluent UI ColorPicker
#535Special thanks to our contributors (in alphabetical order): Brian Krainer Jacobsen, Chad Eiserloh, krishna-vijas, Martin Zamazal.
+TermPicker
: missed documentation for anchorId
property #496FilePicker
: Operations not working for 100+ Items #497FilePicker
: File Sorting not working on file size properly #501PropertyFieldMessage
: documentation typos fix #504FilePicker
: Sorting on Large Libraries / Folders Must do Server-Side Sorting #503Special thanks to our contributors (in alphabetical order): Chad Eiserloh, Chandani Prajapati, Hilton Giesenow.
+FilePicker
: Fixed an internal typo in the codebase #474ListPicker
: documentation updates #490PropertyFieldCollectionData
: Adding new translation for Field Issues label #486FilePicker
: Page Type icons not appearing in the Site Pages library view #475FilePicker
: Tiles are Missing for Site Pages #478FilePicker
: Sorting Does Not Work #487Special thanks to our contributors (in alphabetical order): Chad Eiserloh, JeanNetryValere, Hilton Giesenow, nviolero, Paul Schaeflein.
+PropertyFieldSitePicker
: Site Picker search for any input string #386fast-serve
: bump support to 1.14.0 #386PropertyFieldCollectionData
: allow to conditionally disable specific field in the item #464PropertyFieldListPicker
: Remove debugger #455PropertyFieldCollectionData
: Add button is invisible on a root site #462PropertyFieldCollectionData
: fieldValidation
for custom fields did not get called if no onGetErrorMessage
had been defined #446Special thanks to our contributors (in alphabetical order): Gautam Sheth, Jasey Waegebaert, IRRDC, Markus Langer, Milan Holemans, Peter Cox.
+PropertyFieldListPicker
: ability to provide content type id #441PropertyFieldColorPicker
: provide preview of the current selected color #447Special thanks to our contributors (in alphabetical order): Milan Holemans, Russell gove.
+PropertyFieldMonacoEditor
: new control - Monaco editor #439PropertyFieldCollectionData
: Add button is disabled when it should not be #436Special thanks to our contributors (in alphabetical order): Chad Eiserloh, GuidoZam, João Mendes.
+PropertyFieldFilePicker
: ability to set default tab #412PropertyFieldCollectionData
: ability to use IconPicker
for icon field #423PropertyFieldFilePicker
: Added a feature to allow external links / Added a feature to show the Site Pages in the Site tab #421PropertyFieldSearch
: documentation fix #417FilePicker
: cannot find library by its name in multilingual sites #389PropertyFieldDateTimePicker
: formatDate
property doesn't apply to the textbox value in the property pane #388PropertyFieldCollectionData
: number input shows placeholder instead of 0 #379PropertyFieldChoiceGroupWithCallout
: iconProps not working #424Special thanks to our contributors (in alphabetical order): 19ahmed99, Christian Frizell, GuidoZam.
+PropertyPanePropertyEditor
: Add translations for property editor control button and header #399PropertyFieldCollectionData
: Adds conditional column visibility #394mystrings.d.ts
in definition output #393PropertyFieldCollectionData
: onGetErrorMessage
support for boolean, custom and color fields. #395PropertyFieldCodeEditor
: Added panelWidth
property #404PropertyFieldCollectionData
: Allow falsey keys as dropdown options #397PropertyFieldFilePicker
: Add a handler to close a filepicker #401PropertyPanePropertyEditor
: Minor fix to allow PropertyEditor control to update properties when their current value is blank #384PropertyFieldSitePicker
: Some sites do not show up in Property Field Site Picker control #402PropertyFieldOrder
: Not working with array of objects #396Special thanks to our contributors (in alphabetical order): ellinge, M365Bass, Patrik Hellgren.
+PropertyFieldColorPicker
: Add debounce property to color picker control #352fast-serve
: Add fast-serve support #370PropertyFieldFilePicker
: Stock images url is getting a 404 server error #364PropertyFieldColumnPicker
: Filter not working properly #356PropertyFieldTextWithCallout
: Fix TextWithCallout read-only in SPFx 1.12.1 #372PropertyFieldFilePicker
: React crash on large folders #371PropertyFieldFilePicker
: documentation formatting fix #368PropertyFieldCollectionData
: PropertyFieldCollectionData is not setting sortIdx on resulting collection when using Add and Save #369Special thanks to our contributors (in alphabetical order): Ari Gunawan, Chrisrb05, Gautam Sheth, Konrad K., Mark Bice, Sergei Sergeev.
+PropertyFieldColumnPicker
: Multiselect dropdown option #354PropertyFieldSitePicker
: Site Picker doesn't return sites with title starting from the typed string #355Special thanks to our contributor: Sudharsan Kesavanarayanan.
+PropertyFieldColorPicker
: Add debounce property to color picker control #352PropertyFieldFilePicker
: Stock images url is getting a 404 server error #364PropertyFieldColumnPicker
: Filter not working properly #356PropertyFieldFilePicker
: React crash on large folders #371PropertyFieldCollectionData
: PropertyFieldCollectionData is not setting sortIdx on resulting collection when using Add and Save #369Special thanks to our contributors (in alphabetical order): Chrisrb05, Konrad K., Mark Bice.
+PropertyFieldSitePicker
: Site Picker doesn't return sites with title starting from the typed string #355PropertyFieldEditableComboBox
: new editable combobox control based on Fluent ComboBox. #339PropertyFieldColumnPicker
: new column picker control #343PropertyFieldNumber
: The property field number is loosing decimal value on futher edits of the properties. #344PropertyFieldCollectionData
: validation error persists after item deletion #341FolderPicker
: Correct FolderPicker link alignmentSpecial thanks to our contributors (in alphabetical order): Mike Homol, Sudharsan Kesavanarayanan, Victor Pollet.
+PropertyFieldCodeEditor
: Added an options
property to the CodeEditor. Allows setting of any of the Ace Editor options outlined here #322PropertyFieldCollectionData
: Support for a Color Picker control #326targetProperty
: 'a.b.c') in all controlsPropertyFieldSitePicker
: display site URL #330PropertyPanePropertyEditor
: Support of dynamic properties (DynamicData
) #331PropertyFIeldPassword
: value
is of type string
, not number
. #324PropertyFieldCollectionData
: Dropdown validation not working as expected #321PropertyFieldPeoplePicker
: targetProperty is not updated properly when using nested/complex attributes #221PropertyFieldSitePicker
: if a single subsite is selected all others are selected as well #329Special thanks to our contributors (in alphabetical order): Corey Roth, kflogdev.
+PropertyFieldIconPicker
: new icon picker control #319PropertyFieldTermPicker
: two properties: areTermsSelectable
and areTermsHidden
#313PropertyFieldListPicker
: ability to return Title and relative URL of the list #281index.md
#320Special thanks to our contributors (in alphabetical order): Corey Roth, Gautam Sheth, Jonathan Cardy, Konrad K..
+PropertyFieldTeamPicker
: new Teams picker control #303Special thanks to our contributor: João Mendes.
+PropertyFieldNumber
: ability to set float values #299PropertyFieldGuid
: new GUID editor control #300FolderExplorerService
: support special characters if folder name #305FilePicker
: Stock Images support #306PropertyFieldNumber
: gives "Maximum update depth exceeded" error #282PropertyFieldCollectionData
- required custom field should call onUpdate
before onError
to correctly display required error message #284PropertyFieldNumber
: Improper handling of falsey minValue or maxValue #150PropertyFieldFilePicker
: Org Assets library is not displayed #295Special thanks to our contributors (in alphabetical order): Anoop Tatti, Gautam Sheth, Jim Love.
+Office UI Fabric
version 6 supportPropertyFieldRoleDefinitionPicker
: new Role Definition Picker control #268PropertyFieldFolderPicker
: new Folder Picker control #272PropertyPaneMarkdownContent
: new Markdown Content control #162PropertyFieldCollectionData
: Dynamic options #260PropertyFieldListPicker
control points to PropertyFieldMessage
#269PropertyFieldViewPicker
: Unable to load Views from another site #263Special thanks to our contributors (in alphabetical order): Gautam Sheth, Hugo Bernier, Lars Fernhomberg.
+PropertyFieldMessage
: new Message control #248PropertyFieldSearch
: new Search control #248PropertyFieldSpinner
: new Spinner control #248PropertyFieldFilePicker
: new File Picker control #265PropertyFieldDateTimePicker
: Add ability to hide Date and show only Time field #195PropertyFieldCodeEditor
: Format code #165PropertyFieldDateTimePicker
: The link for OnGetErrorMessage
documentation is broken in this pagePnPTelemetry
import example #259PropertyPanePropertyEditor
:Fix for dynamic data properties #200PropertyFieldPeoplePicker
: People Picker doesn't search for groups #239disabled
prop is set to true
Special thanks to our contributors (in alphabetical order): Lars Fernhomberg, João Mendes, Nanddeep Nachan, Ram, Gautam Sheth.
+PropertyFieldViewPicker
: View picker control #230PropertyFieldPassword
: password editor control #237PropertyFieldSitePicker
documentation title fix #229PropertyFieldSitePicker
: doesn't work at root site #231Special thanks to our contributors (in alphabetical order): Ari Gunawan, Gautam Sheth, Hugo Bernier, João Mendes.
+PropertyFieldSitePicker
: New control that allows the user to select one or multiple sites from the SharePoint Search API. Similar to the SitePicker in the official "News" Web Part #208, #215Telemetry
: Provide a way to opt-out for PnP Telemetry #222PropertyPaneHelpers
: Allows to show a spinner while loading resourcesPropertyFieldSliderWithCallout
: debounce property added #209PropertyFieldCollectionData
#196PropertyFieldOrder
: When items is an empty array, component renders the text '0' #152PropertyFieldCodeEditor
#194PropertyFieldTermPicker
: Tags icon styling issue on IE11 #193PropertyPanePropertyEditor
: Unable to download json export #210PropertyFieldCollectionData
: Fix Data Grid Dragging Issues #217Special thanks to our contributors (in alphabetical order): Antonio Monserrate, rocketboy1908, Piotr Siatka, Ben, Niels Söth, araver.
+PropertyFieldCollectionData
: Add the ability for field validation to the custom fields #187PropertyFieldCollectionData
: Ability to provide custom labels for the save and cancel buttons #187PropertyFieldListPicker
: add ability to filter the control via OData #1841.8.2
#182Special thanks to our contributors (in alphabetical order): araver, Chad Eiserloh.
+PropertyFieldCollectionData
: Add a property to be able to set a custom class on the collection data panel #180PropertyFieldListPicker
: Added listsToExclude
property to the control #176PropertyFieldDateTimePicker
: Add ability to hide the date and time labels #771.8.2
web part #178PropertyFieldTextWithCallout
: still persists property value when error occurred #172PropertyFieldNumber
: not handling changes correctly #170PropertyFieldChoiceGroupWithCallout
: iconProps not working #154PropertyFieldDropdownWithCallout
: Options of type Divider
and Header
are ignored #145Special thanks to our contributors (in alphabetical order): Alex Terentiev, Ward Wilmsen.
+TaxonomyPicker
: Terms are sorted incorrectly under the wrong parent #153EnterpriseTermPicker
: Terms are sorted incorrectly under the wrong parent #156PropertyFieldCollectionData
: Setting to specify if item creation
is enabled/disabled #130PropertyFieldCollectionData
: Setting to specify if item deletion
is enabled/disabled #131PropertyFieldCollectionData
: Implemented a property to specify if field editing
is enabled/disabled #132Chinese
localization #137PropertyFieldColorPicker
: Added a isHidden
property #138PropertyFieldCollectionData
: return the item in the custom renderer #147Russian
localization #142PropertyFieldTermPicker
: fix sort order with lowercased terms #133PropertyFieldCollectionData
: Bug with onCustomRender() #135PropertyFieldCollectionData
: Fixed bug with dropdown rendering in IE #136PropertyFieldNumber
: Min/max number check fix + localization label fixes #141PropertyFieldTermPicker
: Fix layout issues in IE11 #143Special thanks to our contributors (in alphabetical order): Simon-Pierre Plante, Yannick Plenevaux, Alex Terentiev, Roger Zhang.
+PropertyFieldCollectionData
: Fixed issue for loading the control in the local workbench #128office-ui-fabric-react
to the same version as in SPFx 1.7.0 #105PropertyFieldPeoplePicker
: Ability to select only from a specific site #9PropertyFieldCollectionData
: Added support for custom field rendering #122PropertyFieldCollectionData
: Added the functionality to sort the items in the collection #123PropertyFieldDateTimePicker
: Fix for the hours dropdown not showing values #112PropertyFieldCollectionData
: Issue with debounce validation overriding the inserted values #113PropertyPaneWebPartInformation
: Remove redundant 'Description' label #119PropertyFieldCodeEditor
: Handle initial value after updating properties #121Special thanks to our contributor: Erwin van Hunen.
+PropertyPaneWebPartInformation
: New control to show more information about the current web part #108PropertyPanePropertyEditor
: New control that allows you to export/import property pane settings #114PropertyFieldCollectionData
: Allow the user to specify a deferred validation time for each field #98PropertyFieldCollectionData
: added a onRenderOption option to allow custom option rendering #102PropertyFieldNumber
: Introduced the aria label #104PropertyFieldListPicker
: Add the ability to refresh target site while pane is open #109PropertyFieldCollectionData
: Fixed catastrophic backtracking regex issue for URL validation #99Special thanks to our contributors (in alphabetical order): Paul Bullock, Junle Li, PooLP, Erwin van Hunen.
+PropertyFieldCollectionData
: Show error messages #96PropertyFieldPeoplePicker
: Security groups come back with EntityType of FormsRole
rather then SecGroup
#93PropertyFieldCollectionData
: Add the current row's information in the onGetErrorMessage
callback #92PropertyFieldPeoplePicker
: No suggestions returned when using Security Groups, Multi-select and NO duplicates. #90PropertyFieldTermPicker
: Terms which are set as unavailable for tagging are still selectable #94PropertyFieldCollectionData
: Added custom validation for string
, number
, icon
, and URL
field types #74PropertyFieldCollectionData
: Add an option to specify a default value #86PropertyFieldCollectionData
: override placeholder for the inputs #87PropertyFieldCollectionData
: Hide save button when "Add and save" is shown #88PropertyFieldMultiSelect
: fixed an issue where the control didn't retain the preselected values when dropdown options were provided async #85PropertyFieldOrder
: fixed an issue where items where provided async #81PropertyFieldListPicker
: add optional property for target site #21Special thanks to our contributor: Joel Rodrigues.
+npm postinstall
script to automatically add the localization config #64PropertyFieldCollectionData
panel #67PropertyFieldCollectionData
control #66PropertyFieldCollectionData
control #72PropertyFieldCollectionData
control. Related to previous enhancement.TaxonomyPicker
to specify which terms are disabled/not-selectable #69PropertyFieldPeoplePicker
validation error does not clear as expected #68PropertyFieldCollectionData
was added #58PropertyFieldOrder
was added #19PropertyFieldSwatchColorPicker
was added #55PropertyFieldTermPicker
#60PropertyFieldColorPicker
Palette Icon alignment issue in IE11 #56PropertyFieldPeoplePicker
#47PropertyFieldListPicker
control extended with select all lists option #8PropertyFieldTermPicker
control extended with the ability to search terms by typing in the textbox #11 #42 #44 #45SPTermStorePickerService
has a new interface which contains only the required propertiesonGetErrorMessage
property for the PropertyFieldNumber
field control (#36)PropertyFieldMultiSelect
got addedPropertyFieldNumber
got addedPropertyFieldTermPicker
new introduced property to specify to show or hide the term store name: hideTermStoreName
.PropertyFieldTermPicker
updated process when terms were unselected based on ID instead of path.PropertyFieldCodeEditor
got addedPropertyFieldTermPicker
improved with save and cancel buttonPropertyFieldTermPicker
improved with onClick
event on input fieldPropertyFieldButtonWithCallout
controlPropertyFieldCheckboxWithCallout
controlPropertyFieldChoiceGroupWithCallout
controlPropertyFieldWithCallout
controlPropertyLabelWithCallout
controlPropertyLinkWithCallout
controlPropertySliderWithCallout
controlPropertyFieldDropdownWithCallout
controlPropertyFieldTextWithCallout
controlPropertyFieldToggleWithCallout
controlfirstDayOfWeek
option to the date picker controlAll you need to do for testing out a beta release of @pnp/spfx-property-controls
is to install the dependency as follows:
npm install @pnp/spfx-property-controls@next --save
+
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.
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.
+ + + + + + + + + + +This control allows you to explore and select a folder from the property pane. +It also allows the user to create a new folder at the current level being explored.
+Here is an example of the control:
+PropertyFieldFolderPicker example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { IFolder, IPropertyFieldFolderPickerProps , PropertyFieldFolderPicker } from "@pnp/spfx-property-controls/lib/PropertyFieldFolderPicker";
+
Create a new property for your web part, for example:
+export interface IPropertyControlsTestWebPartProps {
+ folderPicker: IFolder;
+}
+
groupFields
of the web part property pane configuration: PropertyFieldFolderPicker('folderPicker', {
+ context: this.context,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ key: "folderPickerId",
+ label: "Folder Picker",
+ selectedFolder: this.properties.folderPicker,
+ canCreateFolders: true,
+ onSelect: ((folder: IFolder) => { console.log(folder); this.properties.folderPicker = folder; }),
+ rootFolder: {
+ Name: "Documents",
+ ServerRelativeUrl: "/sites/testSiteCollection/Shared Documents"
+ },
+}),
+
The PropertyFieldFolderPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
context | +BaseComponentContext | +yes | +The context object of the SPFx loaded webpart. | +
label | +string | +yes | +The label for the control. | +
rootFolder | +IFolder | +yes | +The lowest level folder that can be explored. This can be the root folder of a library. | +
selectedFolder | +IFolder | +yes | +Store the results of the folder picker. | +
defaultFolder | +IFolder | +no | +The default folder to be selected or explored. | +
properties | +any | +yes | +Parent web part properties, this object is used to update the property value. | +
key | +string | +yes | +A unique key that indicates the identity of this control. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the data gets changed. | +
required | +boolean | +no | +Is selection required. | +
disabled | +boolean | +no | +Is the control disabled. | +
canCreateFolders | +boolean | +no | +Allow current user to create folders on the target location. If enabled, you need to ensure that the user has the required permissions. | +
onSelect | +(folder: IFolder): void | +no | +Callback function called after a folder is selected. | +
siteAbsoluteUrl | +string | +no | +The absolute url of the site you want to pick a folder from (if different than the site the webpart is installed on) | +
interface IFolder
The value returned from the selected folder object.
+Value | +Type | +Description | +
---|---|---|
Name | +string | +Name of the folder. | +
ServerRelativeUrl | +string | +Server relative URL of the folder. | +
This control generates a Button Control .
+PropertyFieldButton example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldButton} from '@pnp/spfx-property-controls/lib/PropertyFieldButton';
+
groupFields
of the web part property pane configuration: PropertyFieldButton("", {
+ text={"Button"}
+ key={"buttonID"}
+ disabled={false}
+ className={className}
+ styles={styles}
+ onClick={()=>{alert("Button Clicked")}}
+ iconProps={iconProps}
+ isPrimary={true}
+ isVIsible={true}
+
+ })
+
The PropertyFieldButton
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
styles | +IButtonStyles | +no | +styles object | +
classname | +string | +no | +css ClassName | +
isVisible | +boolean | +yes | +Indicate if button is visible | +
text | +string | +no | +text of button | +
isPrimary | +boolean | +yes | +indicate Button is a primary button | +
iconProps | +IIconProps | +no | +text of button | +
disable | +boolean | +no | +Disable control | +
onClick | +(e:any) =>void | +yes | +Onclick function | +
This control generates a button control with a callout.
+PropertyFieldButtonWithCallout rendering
+ +PropertyFieldButtonWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/Callout';
+import { PropertyFieldButtonWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldButtonWithCallout';
+
groupFields
of the web part property pane configuration:PropertyFieldButtonWithCallout('fakeProperty', {
+ calloutTrigger: CalloutTriggers.Click,
+ key: 'buttonWithCalloutFieldId',
+ calloutContent: React.createElement('p', {}, 'Tests connection to the database with the parameters listed above'),
+ calloutWidth: 150,
+ text: 'Test connection',
+ onClick: () => { /* Code to test db connection */ }
+})
+
The PropertyFieldButtonWithCallout
control uses the same implementation as the default PropertyPaneButton
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a checkbox control with a callout.
+PropertyFieldCheckboxWithCallout rendering
+ +PropertyFieldCheckboxWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/Callout';
+import { PropertyFieldCheckboxWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldCheckboxWithCallout';
+
export interface IPropertyControlsTestWebPartProps {
+ checkboxWithCalloutValue: boolean;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldCheckboxWithCallout('checkboxWithCalloutValue', {
+ calloutTrigger: CalloutTriggers.Click,
+ key: 'checkboxWithCalloutFieldId',
+ calloutContent: React.createElement('p', {}, 'Check the checkbox to accept Application Terms and Conditions'),
+ calloutWidth: 200,
+ text: 'Accept terms and conditions',
+ checked: this.properties.checkboxWithCalloutValue
+})
+
The PropertyFieldCheckboxWithCallout
control uses the same implementation as the default PropertyPaneCheckbox
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a choice group control with a callout.
+PropertyFieldChoiceGroupWithCallout rendering
+ +PropertyFieldChoiceGroupWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/PropertyFieldHeader';
+import { PropertyFieldChoiceGroupWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldChoiceGroupWithCallout';
+
export interface IPropertyControlsTestWebPartProps {
+ choiceGroupWithCalloutValue: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldChoiceGroupWithCallout('choiceGroupWithCalloutValue', {
+ calloutContent: React.createElement('div', {}, 'Select preferable mobile platform'),
+ calloutTrigger: CalloutTriggers.Hover,
+ key: 'choiceGroupWithCalloutFieldId',
+ label: 'Preferred mobile platform',
+ options: [{
+ key: 'iOS',
+ text: 'iOS',
+ checked: this.properties.choiceGroupWithCalloutValue === 'iOS'
+ }, {
+ key: 'Android',
+ text: 'Android',
+ checked: this.properties.choiceGroupWithCalloutValue === 'Android'
+ }, {
+ key: 'Other',
+ text: 'Other',
+ checked: this.properties.choiceGroupWithCalloutValue === 'Other'
+ }]
+})
+
The PropertyFieldChoiceGroupWithCallout
control uses the same implementation as the default PropertyPaneChoiceGroup
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a code editor which can be used to add custom styling or content to your web part.
+PropertyFieldCodeEditor
+ +PropertyFieldCodeEditor editing experience
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldCodeEditor, PropertyFieldCodeEditorLanguages } from '@pnp/spfx-property-controls/lib/PropertyFieldCodeEditor';
+
export interface IPropertyControlsTestWebPartProps {
+ htmlCode: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldCodeEditor('htmlCode', {
+ label: 'Edit HTML Code',
+ panelTitle: 'Edit HTML Code',
+ initialValue: this.properties.htmlCode,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ disabled: false,
+ key: 'codeEditorFieldId',
+ language: PropertyFieldCodeEditorLanguages.HTML,
+ options: {
+ wrap: true,
+ fontSize: 20,
+ // more options
+ }
+})
+
The PropertyFieldCodeEditor
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
panelTitle | +string | +yes | +Title of the code editor panel. | +
initialValue | +string | +no | +Defines the initial code. | +
language | +PropertyFieldCodeEditorLanguages | +no | +Sets the language on the code editor. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
options | +AceOptions | +no | +Additional properties available to the Ace editor. | +
panelWidth | +string | +no | +Width of the panel that contains the Ace editor | +
Enum PropertyFieldCodeEditorLanguages
Name | +
---|
css | +
JavaScript | +
JSON | +
Handlebars | +
HTML | +
Plain Text | +
Sass | +
TypeScript | +
XML | +
This property field control gives you the ability to insert a list / collection data which can be used in your web part. For example: you want to specify multiple locations for showing a weather information.
+The control allows you to specify multiple data types like: string, number, boolean, or dropdown.
+PropertyFieldCollectionData
+ +The type of data you get returned depends on the fields you defined. For the example above, the data looks like this:
+[
+ {"Title":"Person","Lastname":"1","Age":"42","City":"helsinki","Sign":true},
+ {"Title":"Person","Lastname":"2","Age":"42","City":"helsinki","Sign":true}
+]
+
@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldCollectionData, CustomCollectionFieldType } from '@pnp/spfx-property-controls/lib/PropertyFieldCollectionData';
+
export interface IPropertyControlsTestWebPartProps {
+ collectionData: any[];
+}
+
groupFields
of the web part property pane configuration:PropertyFieldCollectionData("collectionData", {
+ key: "collectionData",
+ label: "Collection data",
+ panelHeader: "Collection data panel header",
+ manageBtnLabel: "Manage collection data",
+ value: this.properties.collectionData,
+ fields: [
+ {
+ id: "Title",
+ title: "Firstname",
+ type: CustomCollectionFieldType.string,
+ required: true
+ },
+ {
+ id: "Lastname",
+ title: "Lastname",
+ type: CustomCollectionFieldType.string
+ },
+ {
+ id: "Age",
+ title: "Age",
+ type: CustomCollectionFieldType.number,
+ required: true
+ },
+ {
+ id: "City",
+ title: "Favorite city",
+ type: CustomCollectionFieldType.dropdown,
+ options: [
+ {
+ key: "antwerp",
+ text: "Antwerp"
+ },
+ {
+ key: "helsinki",
+ text: "Helsinki"
+ },
+ {
+ key: "montreal",
+ text: "Montreal"
+ }
+ ],
+ required: true
+ },
+ {
+ id: "Sign",
+ title: "Signed",
+ type: CustomCollectionFieldType.boolean
+ }
+ ],
+ disabled: false
+})
+
Here is an example of how you can render your own controls in the PropertyFieldCollectionData
control:
{
+ id: "customFieldId",
+ title: "Custom Field",
+ type: CustomCollectionFieldType.custom,
+ onCustomRender: (field, value, onUpdate, item, itemId, onError) => {
+ return (
+ React.createElement("div", null,
+ React.createElement("input", { key: itemId, value: value, onChange: (event: React.FormEvent<HTMLInputElement>) => {
+ onUpdate(field.id, event.currentTarget.value);
+ if (event.currentTarget.value === "error") {
+ onError(field.id, "Value shouldn't be equal to error");
+ } else {
+ onError(field.id, "");
+ }
+ }}), " 🎉"
+ )
+ );
+ }
+}
+
The PropertyFieldCollectionData
control can be configured with the following properties:
Property | +Type | +Required | +Description | +Default Value | +
---|---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | ++ |
label | +string | +yes | +Property field label displayed on top. | ++ |
panelHeader | +string | +yes | +Label to be used as the header in the panel. | ++ |
panelDescription | +string | +no | +Property that allows you to specify a description in the collection panel. | ++ |
manageBtnLabel | +string | +yes | +Label of the button to open the panel. | ++ |
saveBtnLabel | +string | +no | +Label of the save button. | ++ |
saveAndAddBtnLabel | +string | +yes | +Label of the save and add button. | ++ |
cancelBtnLabel | +string | +yes | +Label of the cancel button. | ++ |
fields | +ICustomCollectionField[] | +yes | +The fields to be used for the list of collection data. | ++ |
value | +string | +yes | +The collection data value. | ++ |
enableSorting | +boolean | +no | +Specify if you want to be able to sort the items in the collection. | +false | +
disabled | +boolean | +no | +Specify if the control is disabled. | +false | +
disableItemCreation | +boolean | +no | +Allows you to specify if user can create new items. | +false | +
disableItemDeletion | +boolean | +no | +Allows you to specify if users can delete already inserted items. | +false | +
panelClassName | +string | +no | +Allows you to specify a custom CSS class name for the collection data panel. | ++ |
tableClassName | +string | +no | +Allows you to specify a custom CSS class name for the collection data table inside the panel. | ++ |
panelProps | +IPanelProps | +no | +Allows you to pass in props of the panel such as type and size to control the underlying panel. | ++ |
Interface ICustomCollectionField
Property | +Type | +Required | +Description | +
---|---|---|---|
id | +string | +yes | +ID of the field. | +
title | +string | +yes | +Title of the field. This will be used for the label in the table. | +
type | +CustomCollectionFieldType | +yes | +Specifies the type of field to render. | +
disable | +(item: any) => boolean | +no | +Conditionally disable a field. | +
disableEdit | +boolean | +no | +Allows you to specify if a field is disabled for editing. | +
required | +boolean | +no | +Specify if the field is required. | +
options | +IDropdownOption[] | (fieldId: string, item: any) => IDropdownOption[] | +no | +Dropdown options. Only necessary when dropdown type is used. Options can be either a static array or a function that will calculate the values dynamically and can react to the current item. | +
onRenderOption | +IRenderFunction |
+no | +Dropdown custom options render method. Only for the dropdown field type. | +
placeholder | +string | +no | +Placeholder text which will be used for the input field. If not provided the input title will be used. | +
defaultValue | +any | +no | +Specify a default value for the input field. | +
deferredValidationTime | +number | +no | +Field will start to validate after users stop typing for deferredValidationTime milliseconds. Default: 200ms. |
+
onGetErrorMessage | +(value: any, index: number, crntItem: any): string | Promise |
+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. | +
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. |
+
isVisible | +(field: ICustomCollectionField, items: any[]) => boolean | +no | +The method is used to toggle column visibility depending on current state of editing items | +
iconFieldRenderMode | +CollectionIconFieldRenderMode | +no | +Icon field render mode: text box or IconPicker |
+
Enum CustomCollectionFieldType
Type | +Description | +
---|---|
string | +Text field | +
number | +Number field | +
boolean | +Checkbox | +
dropdown | +Dropdown field. You will have to specify the options property when using this field type |
+
fabricIcon | +Name of the Office UI Fabric icon | +
url | +URL field | +
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. |
+
color | +Color field | +
Type CollectionIconFieldRenderMode
export type CollectionIconFieldRenderMode = 'textbox' | 'picker';
+
This control generates a color picker that you can use inside the property pane.
+PropertyFieldColorPicker
+ +PropertyFieldColorPicker color selector
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldColorPicker, PropertyFieldColorPickerStyle } from '@pnp/spfx-property-controls/lib/PropertyFieldColorPicker';
+
export interface IPropertyControlsTestWebPartProps {
+ color: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldColorPicker('color', {
+ label: 'Color',
+ selectedColor: this.properties.color,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ disabled: false,
+ debounce: 1000,
+ isHidden: false,
+ alphaSliderHidden: false,
+ style: PropertyFieldColorPickerStyle.Full,
+ iconName: 'Precipitation',
+ key: 'colorFieldId'
+})
+
The PropertyFieldColorPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
debounce | +number | +no | +Specify delay after which control value will be set. | +
isHidden | +boolean | +no | +Specify if the control needs to be hidden. | +
selectedColor | +string or IColor | +no | +The CSS-compatible string or an IColor object to describe the initial color | +
alphaSliderHidden | +boolean | +no | +When true, the alpha slider control is hidden | +
showPreview | +boolean | +no | +Whether to show color preview box. | +
style | +PropertyFieldColorPickerStyle | +no | +Determines how the control is displayed (defaults to inline) | +
iconName | +string | +no | +The name of the UI Fabric Font Icon to use for Inline display (defaults to Color) | +
valueAsObject | +boolean | +no | +When true, the property is returned as an IColor object. When false (default), the property is returned as a CSS-compatible string | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
Enum PropertyFieldColorPickerStyle
Name | +Description | +
---|---|
Full | +Display the full control in the property pane | +
Inline | +Display the color picker inline | +
By default, the Color Picker returns the value as a CSS-compatible string. This allows you the flexibility of simply assigning the value to an inline style as is and this is usually sufficient. However, this also limits the information directly available to you since the format could be a Hex code, an RGBA value, or even a named color and may not be suitable for advanced scenarios.
+By setting the valueAsObject
property to true, you will always receive a consistent IColor object that provides you detailed information about the chosen color. Here are the properties available in the IColor object:
Property | +Type | +Description | +
---|---|---|
str | +string | +CSS-compatible string (this is the same value that would normally be returned when valueAsObject is false) |
+
hex | +string | +Hex value (does not reflect alpha) | +
r | +number | +Red | +
g | +number | +Green | +
b | +number | +Blue | +
h | +number | +Hue | +
s | +number | +Saturation | +
v | +number | +Value | +
This control generates a column picker field that can be used in the property pane of your SharePoint Framework web parts.
+The control automatically retrieves the columns for a given SharePoint list:
+ + + +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldColumnPicker, PropertyFieldColumnPickerOrderBy } from '@pnp/spfx-property-controls/lib/PropertyFieldColumnPicker';
+
multiSelect
prop to false
, as this control is designed to work with a single list. Store the list id in your web part properties, as follows:export interface IPropertyControlsTestWebPartProps {
+ list: string; // Stores the list ID
+}
+
BEGIN:
and END:
comments below:export interface IPropertyControlsTestWebPartProps {
+ list: string; // Stores the list ID
+
+ // BEGIN: Added
+ column: string; // Stores the single column property (property can be configured)
+ // END: Added
+
+ // BEGIN: Added
+ multiColumn: string; // Stores the multi column property (property can be configured)
+ // END: Added
+}
+
groupFields
of the web part property pane configuration:// Single column selection returning 'Internal Name' of the selected column
+PropertyFieldColumnPicker('column', {
+ label: 'Select a column',
+ context: this.context,
+ selectedColumn: this.properties.column,
+ listId: this.properties.singleListFiltered,
+ disabled: false,
+ orderBy: PropertyFieldColumnPickerOrderBy.Title,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'columnPickerFieldId',
+ displayHiddenColumns: false,
+ columnReturnProperty: IColumnReturnProperty["Internal Name"]
+})
+
+// Multi column selection returning the 'Title' of the selected columns
+PropertyFieldColumnPicker('multiColumn', {
+ label: 'Select columns',
+ context: this.context,
+ selectedColumn: this.properties.multiColumn,
+ listId: this.properties.singleListFiltered,
+ disabled: false,
+ orderBy: PropertyFieldColumnPickerOrderBy.Title,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'multiColumnPickerFieldId',
+ displayHiddenColumns: false,
+ columnReturnProperty: IColumnReturnProperty.Title,
+ multiSelect: true
+})
+
+// Multi column selection returning the 'Title' of the selected columns as a multi-select dropdown
+PropertyFieldColumnPicker('multiColumn', {
+ label: 'Select columns',
+ context: this.context,
+ selectedColumn: this.properties.multiColumn,
+ listId: this.properties.singleListFiltered,
+ disabled: false,
+ orderBy: PropertyFieldColumnPickerOrderBy.Title,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'multiColumnPickerFieldId',
+ displayHiddenColumns: false,
+ columnReturnProperty: IColumnReturnProperty.Title,
+ multiSelect: true
+ renderFieldAs: IPropertyFieldRenderOption["Multiselect Dropdown"]
+})
+
The PropertyFieldColumnPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
listId | +string | +yes | +The ID of the list or library you wish to select a column(s) from. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
selectedColumn | +string | string[] | +no | +Initial selected column(s) of the control. | +
orderBy | +PropertyFieldColumnPickerOrderBy | +no | +Specify the property on which you want to order the retrieve set of columns. | +
multiSelect | +boolean | +no | +Specify if you want to have a single or multi-column picker. By default this is set to false (single column picker). |
+
webAbsoluteUrl | +string | +no | +Absolute Web Url of target site (user requires permissions) | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
columnsToExclude | +string[] | +no | +Defines columns by which should be excluded from the column picker control. You can specify column titles or IDs | +
filter | +string | +no | +Filter columns from OData query. | +
onColumnsRetrieved | +(columns: ISPColumn[]) => PromiseLike |
+no | +Callback that is called before the dropdown is populated. | +
displayHiddenColumns | +boolean | +no | +Hidden columns to be returned or not. By default this is set to false (No Hidden columns) |
+
columnReturnProperty | +IColumnReturnProperty | +no | +Property to be returned for the selected column(s). | +
renderFieldAs | +IPropertyFieldRenderOption | +no | +Property to render the control as Choice group or Multiselect Dropdown . This is applicable only if the multiselect is true . By default the control will be displayed as Choice Group |
+
Enum PropertyFieldColumnPickerOrderBy
Name | +Description | +
---|---|
Id | +Sort by column ID | +
Title | +Sort by column title | +
Enum IColumnReturnProperty
Name | +Description | +
---|---|
Id | +Column ID to be returned |
+
Title | +Column Title to be returned |
+
Internal Name | +Column InternalName to be returned |
+
Enum IPropertyFieldRenderOption
+| Name | Description |
+| ---- | ---- |
+| Choice Group | Render the control as multi-select checkbox list
+| Multiselect Dropdown | Render the control as multi-select dropdown
This control generates a ContentType picker field that can be used in the property pane of your SharePoint Framework web parts.
+The control automatically retrieves the ContentType for a given SharePoint Site or selected SharePoint list:
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldContentTypePicker, PropertyFieldContentTypePickerOrderBy } from '@pnp/spfx-property-controls/lib/PropertyFieldContentTypePicker';
+
multiSelect
prop to false
, as this control is designed to work with a single list. Store the list id in your web part properties, as follows:export interface IPropertyControlsTestWebPartProps {
+ list: string; // Stores the list ID
+}
+
BEGIN:
and END:
comments below:export interface IPropertyControlsTestWebPartProps {
+ list: string; // Stores the list ID
+
+ // BEGIN: Added
+ view: string; // Stores the view ID
+ contentType : string // stores the contenttype ID
+ // END: Added
+}
+
groupFields
of the web part property pane configuration:PropertyFieldContentTypePicker('contentType', {
+ label: 'Select a Content Type',
+ context: this.context,
+ selectedContentType: this.properties.contentType,
+ disabled: false,
+ orderBy: PropertyFieldContentTypeOrderBy.Name,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'contentTypePickerFieldId'
+})
+
PropertyFieldContentTypePicker('contentType', {
+ label: 'Select a Content Type',
+ context: this.context,
+ selectedContentType: this.properties.contentType,
+ disabled: false,
+ webAbsoluteUrl:"https://****.sharepoint.com/sites/*****",
+ orderBy: PropertyFieldContentTypeOrderBy.Name,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'contentTypePickerFieldId'
+})
+
PropertyFieldContentTypePicker('contentType', {
+ label: 'Select a Content Type',
+ context: this.context,
+ selectedContentType: this.properties.contentType,
+ listId: {list-guid} //"0da3b4b7-8ebd-4f15-87ee-afae5cacadad"
+ disabled: false,
+ orderBy: PropertyFieldContentTypeOrderBy.Name,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'contentTypePickerFieldId'
+})
+
PropertyFieldContentTypePicker('contentType', {
+ label: 'Select a Content Type',
+ context: this.context,
+ selectedContentType: this.properties.contentType,
+ listId: {list-guid} //"0da3b4b7-8ebd-4f15-87ee-afae5cacadad"
+ disabled: false,
+ orderBy: PropertyFieldContentTypeOrderBy.Name,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'contentTypePickerFieldId'
+})
+
The PropertyFieldContentTypePicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
listId | +string | +no | +The ID of the list or library you wish to select a contentType from. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
selectedContentType | +string | +string[] | +no | +
orderBy | +PropertyFieldContentTypeOrderBy | +no | +Specify the property on which you want to order the retrieve set of ContentTypes. | +
webAbsoluteUrl | +string | +no | +Absolute Web Url of target site (user requires permissions) | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
contentTypesToExclude | +string[] | +no | +Defines contentTypes by which should be excluded from the contentType picker control. You can specify contentType titles or IDs | +
filter | +string | +no | +Filter contentTypes from OData query. | +
onContentTypesRetrieved | +(contentType: ISPContentType[]) => PromiseLike |
+no | +Callback that is called before the dropdown is populated. | +
Enum PropertyFieldContentTypePickerOrderBy
Name | +Description | +
---|---|
Id | +Sort by contentType ID | +
Title | +Sort by contentType title | +
This control generates a Date and Time picker field that can be used in the property pane of your SharePoint Framework web parts.
+The control can be configured to be date only or date and time.
+Date only
+ +Date picker
+ +Date and time
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldDateTimePicker, DateConvention, TimeConvention } from '@pnp/spfx-property-controls/lib/PropertyFieldDateTimePicker';
+
import { IDateTimeFieldValue } from "@pnp/spfx-property-controls/lib/PropertyFieldDateTimePicker";
+
+export interface IPropertyControlsTestWebPartProps {
+ datetime: IDateTimeFieldValue;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldDateTimePicker('datetime', {
+ label: 'Select the date and time',
+ initialDate: this.properties.datetime,
+ dateConvention: DateConvention.DateTime,
+ timeConvention: TimeConvention.Hours12,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'dateTimeFieldId',
+ showLabels: false
+})
+
The PropertyFieldDateTimePicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
initialData | +IDateTimeFieldValue | +yes | +Initial date and time value of the control. | +
formatData | +function | +no | +Defines a formatDate function that can override the output value. | +
dateConvention | +DateConvention | +no | +Defines the date convention to use. By default this is set to date and time. | +
timeConvention | +TimeConvention | +no | +Defines the time convention to use. By default this is set to 24-hour clock convention. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
showLabels | +boolean | +no | +Specify if labels in front of Date and Time parts should be rendered. By default this is set to true |
+
Interface IDateTimeFieldValue
Property | +Type | +Required | +Description | +
---|---|---|---|
value | +Date | +yes | +JavaScript date value. | +
displayValue | +string | +yes | +Date value formatted as a string. | +
Enum DateConvention
Name | +Description | +
---|---|
DateTime | +Shows the date and time picker | +
Date | +Shows only the date picker | +
Enum TimeConvention
Name | +Description | +
---|---|
Hours12 | +Specify the hours in 12-hours (AM / PM) time convention. | +
Hours24 | +Specify the hours in 24-hours time convention. | +
This control generates a dropdown control with a callout.
+PropertyFieldDropDownWithCallout rendering
+ +PropertyFieldDropDownWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/PropertyFieldHeader';
+import { PropertyFieldDropdownWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldDropdownWithCallout';
+
export interface IPropertyControlsTestWebPartProps {
+ dropdownInfoHeaderKey: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldDropdownWithCallout('dropdownInfoHeaderKey', {
+ calloutTrigger: CalloutTriggers.Hover,
+ key: 'dropdownInfoHeaderFieldId',
+ label: 'Select the version',
+ options: [{
+ key: 'v1.0.0',
+ text: 'v1.0.0'
+ }, {
+ key: 'v1.0.1',
+ text: 'v1.0.1'
+ }, {
+ key: 'v1.0.2',
+ text: 'v1.0.2'
+ }, {
+ key: 'v2.0.0',
+ text: 'v2.0.0'
+ }],
+ selectedKey: this.properties.dropdownInfoHeaderKey,
+ calloutContent: dropdownInfoHeaderCallountContent
+})
+
calloutContent
function as follows:private getDropdownInfoHeaderCalloutContent(): JSX.Element {
+ const selectedKey: string = this.properties.dropdownInfoHeaderKey;
+
+ if (selectedKey) {
+ return React.createElement('div', {}, `you have selected ${selectedKey}`);
+ } else {
+ return React.createElement('div', {}, `you haven't selected any version`);
+ }
+}
+
The PropertyFieldDropDownWithCallout
control uses the same implementation as the default PropertyPaneDropdown
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a term picker that can be used in the property pane of your SharePoint Framework web parts.
+++Disclaimer: This control makes use of the
+@pnp/sp-taxonomy
module to retrieve the managed metadata information. It leads to increase of the bundle/package size if the control is being used. Use the control for "enterprise" scenarios (large term stores with lots of objects) or if you need to request labels for terms.
Empty term picker
+ +Selecting terms
+ +Selected terms in the panel
+ +Empty term picker
+ +Term picker: Auto Complete
+ +Limit the term set to a specific group or termset
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldEnterpriseTermPicker } from '@pnp/spfx-property-controls/lib/PropertyFieldEnterpriseTermPicker';
+
import { IPickerTerms } from "@pnp/spfx-property-controls/lib/PropertyFieldEnterpriseTermPicker";
+
+export interface IPropertyControlsTestWebPartProps {
+ terms: IPickerTerms;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldEnterpriseTermPicker('terms', {
+ label: 'Select terms',
+ panelTitle: 'Select terms',
+ initialValues: this.properties.terms,
+ allowMultipleSelections: true,
+ excludeSystemGroup: false,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ context: this.context,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ limitByGroupNameOrID: 'People',
+ limitByTermsetNameOrID: 'Location',
+ key: 'termSetsPickerFieldId',
+ includeLabels: true
+})
+
The PropertyFieldEnterpriseTermPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
panelTitle | +string | +yes | +TermSet Picker Panel title. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
initialValues | +IPickerTerms | +no | +Defines the selected by default term sets. | +
allowMultipleSelections | +boolean | +no | +Defines if the user can select only one or many term sets. Default value is false. | +
excludeSystemGroup | +boolean | +no | +Indicator to define if the system Groups are exclude. Default is false. | +
limitByGroupNameOrID | +string | +no | +Limit the term sets that can be used by the group name or ID. | +
limitByTermsetNameOrID | +string | +no | +Limit the terms that can be picked by the Term Set name or ID. | +
hideTermStoreName | +boolean | +no | +Specifies if you want to show or hide the term store name from the panel. | +
isTermSetSelectable | +boolean | +no | +Specify if the term set itself is selectable in the tree view. | +
disabledTermIds | +string[] | +no | +Specify which terms should be disabled in the term set so that they cannot be selected. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
resolveDelay | +number | +no | +The delay time in ms before resolving suggestions, which is kicked off when input has been changed. e.g. if a second input change happens within the resolveDelay time, the timer will start over. Only until after the timer completes will onResolveSuggestions be called. Default is 500. | +
includeLabels | +boolean | +no | +Specifies if term labels should be loaded from the store. | +
Interface IPickerTerms
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +The ID of the term | +
name | +string | +yes | +The name of the term | +
path | +string | +yes | +The path of the term | +
termSet | +string | +yes | +The Id of the parent term set of the term | +
termSetName | +string | +no | +The Name of the parent term set of the term | +
PropertyFieldEnterpriseTermPicker
is implemented to be used for "enterprise" Term Stores with large amount of groups, terms sets, and terms. It loads term sets and terms on demand - only at the moment when specified group or term set has been expanded in the Term Store Tree.
+To implement on-demand loading PropertyFieldEnterpriseTermPicker
uses @pnp/sp-taxonomy
module from @pnp/pnpjs
library. It increases the size of a bundle when the control is used.
+Additionaly, PropertyFieldEnterpriseTermPicker
allows to request labels for the terms in the picker.
PropertyFieldTermPicker
loads all the groups and term sets from the term service during the initial request. This approach fits most of the scenarios with small and medium number of objects in a term store. Besides that, PropertyFieldTermPicker
does not use any additional libraries or modules to retrieve data from the taxonomy service which makes it much more lightweight option in comparison with PropertyFieldEnterpriseTermPicker
. See PropertyFieldTermPicker for implementation details.
We recommend to use PropertyFieldTermPicker
control if you don't need on-demand loading or term labels.
File picker control allows to browse and select a file from various places via the property pane. +Currently supported locations
+The control supports all types of file, however it also allows to specify list of extensions for the files that are going to be looked displayed. Currently, only single file selection is supported. +
+File picker support 3 types of views : List, Compact list and Tiles. In case Tiles view is selected, the control shows the thumbnail of the file. +
+The control displays breadcrumb navigation that allows to easily switch folders or document libraries. +
+File picker doesn't load all the files that exist in the folder. Instead, it allows to specify how many results are loaded in a batch, and executes paged requests when new data is required. +
+PropertyFieldFilePicker example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldFilePicker, IPropertyFieldFilePickerProps, IFilePickerResult } from "@pnp/spfx-property-controls/lib/PropertyFieldFilePicker";
+
Create a new property for your web part, for example:
+export interface IPropertyControlsTestWebPartProps {
+ filePickerResult: IFilePickerResult;
+}
+
groupFields
of the web part property pane configuration: PropertyFieldFilePicker('filePicker', {
+ context: this.context,
+ filePickerResult: this.properties.filePickerResult,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ onSave: (e: IFilePickerResult) => { console.log(e); this.properties.filePickerResult = e; },
+ onChanged: (e: IFilePickerResult) => { console.log(e); this.properties.filePickerResult = e; },
+ key: "filePickerId",
+ buttonLabel: "File Picker",
+ label: "File Picker",
+})
+
The PropertyFieldFilePicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
properties | +any | +yes | +Parent web part properties, this object is used to update the property value. | +
key | +string | +yes | +A unique key that indicates the identity of this control. | +
context | +BaseComponentContext | +yes | +Current webpart context. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the data gets changed. | +
label | +string | +no | +Specifies the text describing the file picker. | +
buttonLabel | +string | +no | +Specifies the label of the file picker button. | +
buttonIcon | +string | +no | +In case it is provided the file picker will be rendered as an action button. | +
onSave | +(filePickerResult: IFilePickerResult) => void | +yes | +Handler when the file has been selected and picker has been closed. | +
onChange | +(filePickerResult: IFilePickerResult) => void | +no | +Handler when the file selection has been changed. | +
onCancel | +() => void | +no | +Handler when the file picker panel has been closed without selection of a file. | +
accepts | +string[] | +no | +Array of strings containing allowed files extensions. E.g. [".gif", ".jpg", ".jpeg", ".bmp", ".dib", ".tif", ".tiff", ".ico", ".png", ".jxr", ".svg"] | +
required | +boolean | +no | +Sets the label to inform that the value is required. | +
bingAPIKey | +string | +no | +Used to execute WebSearch. If not provided SearchTab will not be available. | +
disabled | +boolean | +no | +Specifies if the picker button is disabled | +
itemsCountQueryLimit | +number | +no | +Number of items to obtain when executing REST queries. Default 100. | +
hideRecentTab | +boolean | +no | +Specifies if RecentTab should be hidden. | +
hideWebSearchTab | +boolean | +no | +Specifies if WebSearchTab should be hidden. | +
hideStockImages | +boolean | +no | +Specifies if StockImagesTab should be hidden. | +
hideOrganisationalAssetTab | +boolean | +no | +Specifies if OrganisationalAssetTab should be hidden. | +
hideOneDriveTab | +boolean | +no | +Specifies if OneDriveTab should be hidden. | +
hideSiteFilesTab | +boolean | +no | +Specifies if SiteFilesTab should be hidden. | +
hideLocalUploadTab | +boolean | +no | +Specifies if LocalUploadTab should be hidden. | +
hideLinkUploadTab | +boolean | +no | +Specifies if LinkUploadTab should be hidden. | +
storeLastActiveTab | +boolean | +no | +Specifies if last active tab will be stored after the Upload panel has been closed. Note: the value of selected tab is stored in the queryString hash. Default true |
+
defaultSelectedTab | +FilePickerTabType | +no | +Specify a tab to be selected by default. If not specified, it will default to "RecentTab". | +
allowExternalLinks | +boolean | +no | +Specifies if external links should be allowed. | +
checkIfFileExists | +boolean | +no | +When using file links, this property allows the user to choose if the control should check if the link point to a file that exists or not. | +
includePageLibraries | +boolean | +no | +Specifies if site pages should be displayed. | +
interface IFilePickerResult
The value returned from the selected file object.
+Value | +Type | +Description | +
---|---|---|
fileName | +string | +File name of the result with the extension. | +
fileNameWithoutExtension | +string | +File name of the result without the extension. | +
fileAbsoluteUrl | +string | +Absolute URL of the file. Null in case of file upload. | +
downloadFileContent | +() => Promise |
+Function allows to download file content. Returns File object. | +
This control generates a Grid Control .
+PropertyFieldGrid example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldGrid, IItem} from '@pnp/spfx-property-controls/lib/PropertyFieldGrid';
+
- define the items to show in the grid:
+
+const gridItems:IItem[] = [
+ {
+ key: "1",
+ icon: React.createElement(DocumentBulletListRegular) ,
+ title: "File 1",
+ description: "This is the first document"
+ },
+ {
+ key: "2",
+ icon: React.createElement(DocumentBulletListRegular) ,
+ title: "File 2",
+ description: "This is the 2 document"
+ },
+ {
+ key: "3",
+ icon: React.createElement(DocumentBulletListRegular) ,
+ title: "File 3",
+ description: "This is the 3 document"
+ },
+ {
+ key: "4",
+ icon: React.createElement(DocumentBulletListRegular) ,
+ title: "File 4",
+ description: "This is the 4 document"
+ }
+ ];
+
+- Add the custom property Grid to the `groupFields` of the web part property pane configuration:
+
+ PropertyFieldGrid('gridItems', {
+ multiSelect: true,
+ items: gridItems,
+ label: 'Grid Items',
+ key: 'gridFieldId',
+ defaultSelectedItems: this.properties.gridItems,
+ maxHeight: 500,
+ className: 'gridClass',
+ styles: {padding: 10},
+ isVisible: true,
+ maxHeight: 500,
+ column1Label: 'File',
+ column2Label: 'Location',
+ onSelected: (item: IItem[]) => {
+ console.log(item);
+ }
+ )
+
The PropertyFieldGrid
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
styles | +IButtonStyles | +no | +styles object (root container) | +
classname | +string | +no | +css ClassName (root container) | +
isVisible | +boolean | +no | +Indicate if grid is visible | +
label | +string | +no | +label of Grid | +
defaultSelectedItems | +(items:IItem[]) =>void | +no | +defined default Item selected | +
maxHeigth | +number | +no | +max height of the container , default 400px | +
onSelected | +item[] | +no | +selected Items when are selected | +
items | +IItem[] | +yes | +Items to show | +
multiSelect | +boolean | +no | +Enable multiSelect , default single | +
column1Label | +string | +no | +Label for header of first grid column | +
column2Label | +string | +no | +Label for header of second grid column | +
This control generates an input field for GUID. Incorrect GUID entered will result into an invalid input.
+PropertyFieldGuid example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldGuid } from '@pnp/spfx-property-controls/lib/PropertyFieldGuid';
+
export interface IPropertyControlsTestWebPartProps {
+ guid: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldGuid('guid', {
+ key: 'guid',
+ label: "GUID",
+ value: this.properties.guid
+})
+
errorMessage
property with the following syntax:PropertyFieldGuid('guid', {
+ key: 'guid',
+ label: "GUID",
+ value: this.properties.guid,
+ errorMessage: "Please enter a correct GUID"
+})
+
The PropertyFieldGuid
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
label | +string | +yes | +Property field label displayed on top. | +
value | +string | +no | +Value to be displayed in the Guid field. | +
errorMessage | +string | +no | +If set, this will be displayed as an error message. | +
Property pane icon picker control that allows to search and select an icon from office-ui-fabric-react icons.
+The control allows selecting an icon from the list of icons available in the office-ui-fabric-react library. Icon list is a static copy of available icons. Currently, only one icon selection is supported. +
+Icon picker always opens a new panel where you can pick an icon. The panel displays all the icons and maintains readability. Picker does not displays selected icon outside the panel. +
+@pnp/spfx-property-controls
dependency. Check out the getting started page for more information about installing the dependency.import { PropertyFieldIconPicker } from '@pnp/spfx-property-controls/lib/PropertyFieldIconPicker';
+
PropertyFieldIconPicker
control in your code as follows:PropertyFieldIconPicker('iconPicker', {
+ currentIcon: this.properties.iconPicker,
+ key: "iconPickerId",
+ onSave: (icon: string) => { console.log(icon); this.properties.iconPicker = icon; },
+ onChanged:(icon: string) => { console.log(icon); },
+ buttonLabel: "Icon",
+ renderOption: "panel",
+ properties: this.properties,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ label: "Icon Picker"
+ }),
+
The PropertyFieldIconPicker component can be configured with the following properties:
+Property | +Type | +Required | +Description | +
---|---|---|---|
buttonLabel | +string | +no | +Specifies the label of the icon picker button. | +
onSave | +(iconName: string) => void | +yes | +Handler when the icon has been selected and picker has been closed. | +
onChanged | +(iconName: string) => void | +no | +Handler when the icon selection has been changed. | +
disabled | +boolean | +no | +Specifies if the picker button is disabled | +
buttonClassName | +boolean | +no | +If provided, additional class name will be added to the picker button | +
panelClassName | +boolean | +no | +If provided, additional class name will be added to the picker panel | +
currentIcon | +string | +no | +Specifies default selected icon | +
renderOption | +dialog , panel |
+no | +Specifies how to render list of Icons, Values : 'Panel' or 'Dialog' default value 'Panel' | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the teams get changed. |
+
properties | +any | +yes | +Parent web part properties, this object is used to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
label | +string | +no | +A label to describe the icon picker control. | +
This control generates a label control with a callout.
+PropertyFieldLabelWithCallout rendering
+ +PropertyFieldLabelWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/Callout';
+import { PropertyFieldLabelWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldLabelWithCallout';
+
groupFields
of the web part property pane configuration:PropertyFieldLabelWithCallout('fakeProp', {
+ calloutTrigger: CalloutTriggers.Click,
+ key: 'LabelWithCalloutFieldId',
+ calloutContent: 'Use dropdowns below to select list and list\'s field to work with',
+ calloutWidth: 200,
+ text: 'Select List and Field'
+})
+
The PropertyFieldLabelWithCallout
control uses the same implementation as the default PropertyPaneLabel
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a link control with a callout.
+PropertyFieldLinkWithCallout rendering
+ +PropertyFieldLinkWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/Callout';
+import { PropertyFieldLinkWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldLinkWithCallout';
+
groupFields
of the web part property pane configuration:PropertyFieldLinkWithCallout('fakeProp', {
+ calloutTrigger: CalloutTriggers.Click,
+ key: 'linkWithCalloutFieldId',
+ calloutContent: React.createElement('p', {}, 'Click the link to open a new page with Application Terms & Conditions'),
+ calloutWidth: 200,
+ text: 'Terms & Conditions',
+ href: 'https://github.com/pnp/sp-dev-fx-property-controls',
+ target: '_blank'
+})
+
The PropertyFieldLinkWithCallout
control uses the same implementation as the default PropertyPaneLink
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a list picker field that can be used in the property pane of your SharePoint Framework web parts.
+The control can be configured as a single or multi-selection list picker:
+Single list picker
+ +Multi list picker
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldListPicker, PropertyFieldListPickerOrderBy } from '@pnp/spfx-property-controls/lib/PropertyFieldListPicker';
+
export interface IPropertyControlsTestWebPartProps {
+ lists: string | string[]; // Stores the list ID(s)
+}
+
groupFields
of the web part property pane configuration:PropertyFieldListPicker('lists', {
+ label: 'Select a list',
+ selectedList: this.properties.lists,
+ includeHidden: false,
+ orderBy: PropertyFieldListPickerOrderBy.Title,
+ disabled: false,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ context: this.context,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'listPickerFieldId'
+})
+
The PropertyFieldListPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
selectedList | +string | string[] | IPropertyFieldList | IPropertyFieldList[] | +no | +Initial selected list set of the control. | +
baseTemplate | +number | +no | +BaseTemplate ID of the lists or libraries you want to return. | +
includeHidden | +boolean | +no | +Specify if you want to include hidden lists in the list picker. By default this is set to true . |
+
orderBy | +PropertyFieldListPickerOrderBy | +no | +Specify the property on which you want to order the retrieve set of lists. | +
multiSelect | +boolean | +no | +Specify if you want to have a single or multi-list picker. By default this is set to false (single list picker). |
+
showSelectAll | +boolean | +no | +Specify if you want the Select All checkbox. By default this is set to false (mult-list picker only). |
+
selectAllInList | +boolean | +no | +Specify where to show the Select All checkbox. When false (default), checkbox is shown before the label, when true it is shown with the lists (mult-list picker only). | +
selectAllInListLabel | +string | +no | +The label to use for the in list select all checkbox (mult-list picker only). | +
webAbsoluteUrl | +string | +no | +Absolute Web Url of target site (user requires permissions) | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
listsToExclude | +string[] | +no | +Defines list titles which should be excluded from the list picker control (list title or ID). | +
filter | +string | +no | +Filter list from OData query (takes precedence over Hidden and BaseTemplate Filters). | +
onListsRetrieved | +(lists: ISPList[]) => PromiseLike |
+no | +Callback that is called before the dropdown is populated. | +
includeListTitleAndUrl | +boolean | +no | +Specifies if the picker returns list id, title and url as an object instead on id. | +
contentTypeId | +string | +no | +Specifies a content type ID , or a portion of one. If specified, all the lists presented in the control will have at least one content type beginning with the specified content type id. | +
Interface IPropertyFieldList
Property | +Type | +Required | +Description | +
---|---|---|---|
id | +string | +yes | +The ID of the list | +
title | +string | +no | +List's title | +
url | +string | +no | +List's server relative url | +
Enum PropertyFieldListPickerOrderBy
Name | +Description | +
---|---|
Id | +Sort by list / library ID | +
Title | +Sort by list / library title | +
This control generates a Message Bar that will show messages .
+PropertyFieldMessage example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldMessage} from '@pnp/spfx-property-controls/lib/PropertyFieldMessage';
+import { MessageBarType } from 'office-ui-fabric-react/lib/MessageBar';
+
groupFields
of the web part property pane configuration: PropertyFieldMessage("", {
+ key: "MessageKey",
+ text: "Something went wrong... try later.",
+ messageType: MessageBarType.error,
+ isVisible: true
+ })
+
The PropertyFieldMessage
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
text | +string | +yes | +Message Text | +
messageType | +MessageBarType | +yes | +type of message | +
multiline | +boolean | +no | +Indicate if message is multiline | +
classname | +string | +no | +css ClassName | +
isVisible | +boolean | +yes | +Indicate if message is visible | +
This control implement Microsoft Monaco Editor.
+PropertyFieldMonacoEditor example usage
++ +
+@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldMonacoEditor } from '@pnp/spfx-property-controls/lib/PropertyFieldMonacoEditor';
+
export interface IPropertyControlsTestWebPartProps {
+ monacoEditorValue: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldMonacoEditor('monacoEditor', {
+ key: 'monacoEditor',
+ value: this.properties.monacoEditorValue,
+ showMiniMap: true,
+ onChange: this.monacoChange ,
+ language:"json",
+ showLineNumbers:true,
+ }),
+
The PropertyFieldMonacoEditor
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
value | +number | +yes | +Value field. | +
theme | +string | +no | +'vs-dark' | +
readOnly | +boolean | +no | +editor is read only | +
showLineNumbers | +boolean | +no | +Show line number - default no | +
showMiniMap | +boolean | +no | +Show Mini Map - default yes | +
onChange | +(newValue:string) => void; | +no | +If set, this method is used to get the the input value when it changed | +
language | +string | +yes | +language, please see https://microsoft.github.io/monaco-editor/index.html for all supported languages | +
jsonDiagnosticsOptions | +monaco.languages.json.DiagnosticsOptions | +no | +see https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.json.DiagnosticsOptions.html | +
jscriptDiagnosticsOptions | +monaco.languages.typescript.DiagnosticsOptions | +no | +see https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.typescript.DiagnosticsOptions.html | +
panelWidth | +number | +no | +Panel Width default 800px. | +
This control generates a dropdown with the possibility of selecting multiple values.
+Multi-select field rendering
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldMultiSelect } from '@pnp/spfx-property-controls/lib/PropertyFieldMultiSelect';
+
export interface IPropertyControlsTestWebPartProps {
+ multiSelect: string[];
+}
+
groupFields
of the web part property pane configuration:PropertyFieldMultiSelect('multiSelect', {
+ key: 'multiSelect',
+ label: "Multi select field",
+ options: [
+ {
+ key: "EN",
+ text: "EN"
+ },
+ {
+ key: "FR",
+ text: "FR"
+ },
+ {
+ key: "NL",
+ text: "NL"
+ }
+ ],
+ selectedKeys: this.properties.multiSelect
+})
+
The PropertyFieldMultiSelect
control uses the same implementation as the default PropertyPaneDropdown
control and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
selectedKeys | +string[] OR number[] | +no | +Specifies the selected keys. | +
++ + + + + + + + + + +Important: Do not make use of the
+selectedKey
property. This property is inherited from thePropertyPaneDropdown
control.
This control generates an input field for numbers. Text is not allowed as this will result into an invalid input.
+PropertyFieldNumber example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldNumber } from '@pnp/spfx-property-controls/lib/PropertyFieldNumber';
+
export interface IPropertyControlsTestWebPartProps {
+ numberValue: number;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldNumber("numberValue", {
+ key: "numberValue",
+ label: "Number value only",
+ description: "Number field description",
+ value: this.properties.numberValue,
+ maxValue: 10,
+ minValue: 1,
+ disabled: false
+})
+
onGetErrorMessage
property as follows:PropertyFieldNumber("numberValue", {
+ key: "numberValue",
+ label: "Number value only",
+ description: "Number field description",
+ value: this.properties.numberValue,
+ maxValue: 10,
+ minValue: 1,
+ disabled: false,
+ onGetErrorMessage: (value: number) => {
+ if (value % 2 !== 0) {
+ return 'Only even numbers are allowed';
+ }
+ return '';
+ }
+})
+
The PropertyFieldNumber
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
label | +string | +yes | +Property field label displayed on top. | +
description | +string | +no | +The number field input description. | +
placeholder | +string | +no | +Placeholder text to be displayed in the number field. | +
value | +number | +no | +Value to be displayed in the number field. | +
maxValue | +number | +no | +Maximum number that can be inserted. | +
minValue | +number | +no | +Minimum number that can be inserted. | +
ariaLabel | +string | +no | +The aria label for the number field. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
errorMessage | +string | +no | +If set, this will be displayed as an error message. | +
onGetErrorMessage | +(value: number) => string | +no | +If set, this method is used to get the validation error message and determine whether the input value is valid or not. | +
deferredValidationTime | +number | +no | +Number field will start to validate after users stop typing for deferredValidationTime milliseconds. |
+
precision | +number | +no | +Precision to round the value to. If the precision is not defined the value is not rounded. | +
This control generates a list that can be easily reordered using drag and drop and/or arrow buttons.
+PropertyFieldOrder
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldOrder } from '@pnp/spfx-property-controls/lib/PropertyFieldOrder';
+
export interface IPropertyControlsTestWebPartProps {
+ orderedItems: Array<any>;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldOrder("orderedItems", {
+ key: "orderedItems",
+ label: "Ordered Items",
+ items: this.properties.orderedItems,
+ properties: this.properties,
+ onPropertyChange: this.onPropertyPaneFieldChanged
+})
+
By default, items will render using the toString()
method for each element in your items
array. This works well for simple arrays of strings, numbers, etc.
When working with an array of objects, you can specify the name of the property to use as the display value by specifying the textProperty
property.
For instance, for an array of objects like the following:
+[
+ {"text": "Cat", "iconName": "Cat"},
+ {"text": "Pig", "iconName": "Savings"},
+ {"text": "Human", "iconName": "Running"},
+ {"text": "Robot", "iconName": "Robot"},
+ {"text": "Dog", "iconName": "FangBody"}
+]
+
To prevent every item from showing as [object Object]
, you can set the textProperty
property to the name of the property you would like to use for display:
PropertyFieldOrder("orderedItems", {
+ key: "orderedItems",
+ label: "Ordered Items",
+ items: this.properties.orderedItems,
+ textProperty: "text",
+ properties: this.properties,
+ onPropertyChange: this.onPropertyPaneFieldChanged
+})
+
You can fully customize how items are rendered by providing the onRenderItem
callback function and returning whatever JSX.Element
you want.
For example, you can define your function in a tsx file like this:
+import * as React from 'react';
+
+export const orderedItem = (item:any, index:number): JSX.Element => {
+ return (
+ <span>
+ <i className={"ms-Icon ms-Icon--" + item.iconName} style={{paddingRight:'4px'}}/>
+ {item.text}
+ </span>
+ );
+};
+
You can then import this function into your webpart using the relative path to this file similar to the following:
+import { orderedItem } from './components/OrderedItem';
+
Then you can simply reference it in your PropertyFieldOrder
:
PropertyFieldOrder("orderedItems", {
+ key: "orderedItems",
+ label: "Ordered Items",
+ items: this.properties.orderedItems,
+ onRenderItem: orderedItem,
+ properties: this.properties,
+ onPropertyChange: this.onPropertyPaneFieldChanged
+})
+
The PropertyFieldOrder
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
items | +Array |
+yes | +An array of values to reorder. | +
textProperty | +string | +no | +The property to use for display, when undefined, the toString() method of the object is used (ignored when the onRenderItem function is specified) | +
maxHeight | +number | +no | +The maximum height for the items in px (when not set, the control expands as necessary) | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
disableDragAndDrop | +boolean | +no | +When true, drag and drop reordering is disabled (defaults to false) | +
removeArrows | +boolean | +no | +When true, arrow buttons are not displayed (defaults to false) | +
moveUpIconName | +string | +no | +The name of the UI Fabric Font Icon to use for the move up button (defaults to ChevronUpSmall) | +
moveDownIconName | +string | +no | +The name of the UI Fabric Font Icon to use for the move down button (defaults to ChevronDownSmall) | +
onRenderItem | +function | +no | +Optional callback to provide custom rendering of the item (default is simple text based on either item or the property identified in the textProperty) | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
This control generates an input field for password. Text is not visible .
+PropertyFieldPassword example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldPassword } from '@pnp/spfx-property-controls/lib/PropertyFieldPassword';
+
export interface IPropertyControlsTestWebPartProps {
+ password: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldPassword("password", {
+ key: "password",
+ label: "password",
+ value: this.properties.password,
+ onChanged : (value: string) => {
+ console.log(value);
+ }
+})
+
The PropertyFieldPassword
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
label | +string | +no | +Property field label displayed on top. | +
value | +string | +no | +Value to be displayed in the number field. | +
onChanged | +(value: string) => void | +no | +If set, this method is used to get the the input value | +
This control generates a people / group picker that can be used in the property pane of your SharePoint Framework web parts.
+Searching for persons
+ +Searching for groups
+ +Selected people / groups
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldPeoplePicker, PrincipalType } from '@pnp/spfx-property-controls/lib/PropertyFieldPeoplePicker';
+
import { IPropertyFieldGroupOrPerson } from "@pnp/spfx-property-controls/lib/PropertyFieldPeoplePicker";
+
+export interface IPropertyControlsTestWebPartProps {
+ people: IPropertyFieldGroupOrPerson[];
+}
+
groupFields
of the web part property pane configuration:PropertyFieldPeoplePicker('people', {
+ label: 'PropertyFieldPeoplePicker',
+ initialData: this.properties.people,
+ allowDuplicate: false,
+ principalType: [PrincipalType.Users, PrincipalType.SharePoint, PrincipalType.Security],
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ context: this.context,
+ properties: this.properties,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'peopleFieldId'
+})
+
The PropertyFieldPeoplePicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
initialData | +IPropertyFieldGroupOrPerson[] | +no | +Initial data to load in the people picker (optional). | +
allowDuplicate | +boolean | +no | +Defines if the People Picker allows to select duplicated users (optional). | +
multiSelect | +boolean | +no | +Define if you want to allow multi user / group selection. (optional, true by default). | +
principalType | +PrincipalType[] | +no | +Define which type of data you want to retrieve: User, SharePoint groups, Security groups. Multiple are possible. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
targetSiteUrl | +string | +no | +Specify the URL of the target site from which you want to retrieve the users/groups. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
Interface IPropertyFieldGroupOrPerson
Property | +Type | +Required | +Description | +
---|---|---|---|
id | +string | +no | +The ID of the group | +
description | +string | +no | +Group description | +
fullName | +string | +yes | +Users' full name or group display name | +
login | +string | +yes | +Users' login or group provider name (when security group) or group account name (when SharePoint group). | +
string | +no | +Users' email | +|
jobTitle | +string | +no | +Users' job title | +
initials | +string | +no | +Users' initials | +
imageUrl | +string | +no | +Users' profile image URL | +
Enum PrincipalType
The PrincipalType
enum can be used to specify the types of information you want to query: User, Security groups, and/or SharePoint groups.
Name | +Description | +
---|---|
Users | +To specify if you want to retrieve users. | +
Security | +To specify if you want to retrieve security groups. | +
SharePoint | +To specify if you want to retrieve SharePoint groups. | +
Role Definition picker control allows to select role definitions of a specific web via the property pane.
+The control allows a you to pick role definitions from a dropdown control. It supports role definition selection using the dropdown control of Office fabric UI with multi-select enabled. +
+PropertyFieldRoleDefinitionPicker example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { IBasePermissions, IPropertyFieldRoleDefinitionPickerProps , PropertyFieldRoleDefinitionPicker, RoleTypeKind , IRoleDefinitionInformation } from "@pnp/spfx-property-controls/lib/PropertyFieldRoleDefinitionPicker";
+
Create a new property for your web part, for example:
+export interface IPropertyControlsTestWebPartProps {
+ roleDefinitions: IRoleDefinitionInformation[];
+}
+
groupFields
of the web part property pane configuration: PropertyFieldRoleDefinitionPicker('roleDefinitions', {
+ context: this.context,
+ label: "Role Definitions",
+ roleDefinitions: this.properties.roleDefinitions,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ key: "roleDefinitionPickerId",
+ selectedRoleDefinition:["Full Control"],
+ roleDefinitionsToExclude: ["System.LimitedView"],
+})
+
The PropertyFieldRoleDefinitionPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
properties | +any | +yes | +Parent web part properties, this object is used to update the property value. | +
key | +string | +yes | +A unique key that indicates the identity of this control. | +
context | +BaseComponentContext | +yes | +Current webpart context. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the data gets changed. | +
label | +string | +no | +Specifies the text describing the role definition picker. | +
webAbsoluteUrl | +string | +no | +Absolute Web Url of target site (user requires permissions) | +
required | +boolean | +no | +Sets the label to inform that the value is required. | +
disabled | +boolean | +no | +Specifies if the picker button is disabled | +
roleDefinitions | +IRoleDefinitionInformation[] | +yes | +The value of selected role definitions | +
multiSelect | +boolean | +no | +Specify if you want to have a single or multi-select role definition picker. By default this is set to true (multi-select role picker). |
+
selectedRoleDefinition | +string[] | +no | +Pre-selected role definitions for the picker control | +
roleDefinitionsToExclude | +string[] | +no | +Role definitions to be excluded from the picker control | +
onRoleDefinitionsRetrieved | +(roleDefinitions: IRoleDefinitionInformation[]) => PromiseLike<IRoleDefinitionInformation[]> | IRoleDefinitionInformation[] |
+no | +Callback that is called before the dropdown is populated. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
interface IRoleDefinitionInformation
The value returned from the selected role definition.
+Value | +Type | +Description | +
---|---|---|
Id | +number | +Id of the role definition. | +
Name | +string | +Name of the selected role definition. | +
Description | +string | +Description of selected role definition. | +
Hidden | +boolean | +Whether selected role definition is hidden or not. | +
Order | +number | +Order of selected role definition. | +
RoleTypeKind | +RoleTypeKind | +RoleTypeKind of selected role definition. | +
BasePermissions | +IBasePermissions | +BasePermissions of selected role definition. | +
interface IBasePermissions
Value | +Type | +
---|---|
Low | +number | +
High | +number | +
type RoleTypeKind
Value | +Type | +
---|---|
RoleTypeKind | +0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+
This control generates an input field for Search.
+PropertyFieldSearch example usage
+ + +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldSearch } from '@pnp/spfx-property-controls/lib/PropertyFieldSearch';
+
export interface IPropertyControlsTestWebPartProps {
+ searchValue: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldSearch("searchValue", {
+ key: "search",
+ placeholder: 'Search libraries',
+ value: this.properties.searchValue,
+ onSearch: this._onSearch,
+ styles: { root: { margin: 10 } }
+ }),
+
The PropertyFieldSearch
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
PlaceHolder | +string | +no | +Property field PlaceHolder displayed on input. | +
value | +number | +no | +Value to be displayed in field. | +
underlined | +boolean | +no | +Indicate if control is render as underline | +
styles | +ISearchBoxStyles | +no | +Styles to apply | +
className | +string | +no | +Class Name | +
onSearch | +(value: string) => void | +no | +If set, this method is used to get the the input value when user press enter key | +
onChange | +(value: string) => void | +no | +If set, this method is used to get the the input value when it changed | +
onClear | +(ev: any) => void | +no | +If set, this method is fired when user click the clear (cross) on the input field | +
onEscape | +(ev: any) => void | +no | +If set, this method is fired when user press the escape key | +
This control generates a site picker that can be used in the property pane of your SharePoint Framework web parts.
+Searching for sites
+ +Selected sites
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldSitePicker } from '@pnp/spfx-property-controls/lib/PropertyFieldSitePicker';
+
import { IPropertyFieldSite } from "@pnp/spfx-property-controls/lib/PropertyFieldSitePicker";
+
+export interface IPropertyControlsTestWebPartProps {
+ sites: IPropertyFieldSite[];
+}
+
groupFields
of the web part property pane configuration:PropertyFieldSitePicker('sites', {
+ label: 'Select sites',
+ initialSites: this.properties.sites,
+ context: this.context,
+ deferredValidationTime: 500,
+ multiSelect: true,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ key: 'sitesFieldId'
+})
+
The PropertyFieldSitePicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
initialSites | +IPropertyFieldSite[] | +no | +Initial sites to load in the site picker (optional). | +
multiSelect | +boolean | +no | +Define if you want to allow multiple sites selection. (optional, false by default). | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the sites get changed. |
+
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
trimDuplicates | +boolean | +no | +Specifies if the duplicates should be trimmed. false by default. Applicable if mode is set to site or web. | +
additionalQuery | +string | +no | +If provided will be added to the search query as AND part. Applicable if mode is set to site or web. | +
Interface IPropertyFieldSite
Property | +Type | +Required | +Description | +
---|---|---|---|
id | +string | +no | +The ID of the site | +
title | +string | +no | +Site's display name | +
url | +string | +no | +URL to the site | +
webId | +string | +no | +The ID of the web | +
hubSiteId | +string | +no | +ID of the hub site. | +
This control generates a slider control with a callout.
+PropertyFieldSliderWithCallout rendering
+ +PropertyFieldSliderWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/PropertyFieldHeader';
+import { PropertyFieldSliderWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldSliderWithCallout';
+
export interface IPropertyControlsTestWebPartProps {
+ sliderWithCalloutValue: number;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldSliderWithCallout('sliderWithCalloutValue', {
+ calloutContent: React.createElement('div', {}, 'Select background image opacity'),
+ calloutTrigger: CalloutTriggers.Click,
+ calloutWidth: 200,
+ key: 'sliderWithCalloutFieldId',
+ label: 'Opacity',
+ max: 100,
+ min: 0,
+ step: 1,
+ showValue: true,
+ value: this.properties.sliderWithCalloutValue,
+ debounce: 1000
+})
+
The PropertyFieldSliderWithCallout
control uses the same implementation as the default PropertyPaneSlider
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
debounce | +number | +no | +Time specified in milliseconds after which the onChanged handler is going to be called. | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a spin button which allows the user to incrementally adjust a value in small steps.
+PropertyFieldSpinButton initial render
+ +PropertyFieldSpinButton increment
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldSpinButton } from '@pnp/spfx-property-controls/lib/PropertyFieldSpinButton';
+
export interface IPropertyControlsTestWebPartProps {
+ spinValue: number;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldSpinButton('spinValue', {
+ label: 'Spin Value',
+ initialValue: this.properties.spinValue,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ disabled: false,
+ suffix: 'px',
+ min: 0,
+ max: 5,
+ step: 0.25,
+ decimalPlaces: 2,
+ incrementIconName: 'CalculatorAddition',
+ decrementIconName: 'CalculatorSubtract',
+ key: 'spinButtonFieldId'
+})
+
The PropertyFieldSpinButton
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
initialValue | +number | +no | +Initial number value of the control. | +
step | +number | +no | +The difference between the two adjacent values of the SpinButton (default is 1) | +
min | +number | +no | +The minimum value (no minimum when unspecified) | +
max | +number | +no | +The minimum value (no minimum when unspecified) | +
incrementIconName | +string | +no | +The name of the UI Fabric Font Icon to use for the increment button (defaults to ChevronUpSmall) | +
decrementIconName | +string | +no | +The name of the UI Fabric Font Icon to use for the decrement button (defaults to ChevronDownSmall) | +
suffix | +string | +no | +An optional string value to append to the field display | +
decimalPlaces | +number | +no | +The number of decimal places to show/allow (defaults to 0) | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
This control generates a Message Bar that will show messages .
+PropertyFieldSpinner example usage
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldSpinner} from '@pnp/spfx-property-controls/lib/PropertyFieldSpinner';
+
groupFields
of the web part property pane configuration: PropertyFieldSpinner("", {
+ key: "sp1",
+ size: SpinnerSize.medium,
+ isVisible: true,
+ label: "Loading ..."
+ })
+
The PropertyFieldSpinner
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +An unique key that indicates the identity of this control. | +
size | +SpinnerSize | +yes | +Size of Spinner | +
classname | +string | +no | +css ClassName | +
isVisible | +boolean | +yes | +Indicate if message is visible | +
Label | +string | +no | +Label to Show | +
This control generates a swatch color picker that you can use inside the property pane.
+PropertyFieldSwatchColorPicker
+ +PropertyFieldColorPicker color selector
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldSwatchColorPicker, PropertyFieldSwatchColorPickerStyle } from '@pnp/spfx-property-controls/lib/PropertyFieldSwatchColorPicker';
+
export interface IPropertyControlsTestWebPartProps {
+ color: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldSwatchColorPicker('color', {
+ label: 'Swatch Color',
+ selectedColor: this.properties.color,
+ colors: [
+ { color: '#ffb900', label: 'Yellow' },
+ { color: '#fff100', label: 'Light Yellow' },
+ { color: '#d83b01', label: 'Orange'},
+ { color: '#e81123', label: 'Red' },
+ { color: '#a80000', label: 'Dark Red'},
+ { color: '#5c005c', label: 'Dark Magenta' },
+ { color: '#e3008c', label: 'Light Magenta'},
+ { color: '#5c2d91', label: 'Purple'},
+ { color: '#0078d4', label: 'Blue'},
+ { color: '#00bcf2', label: 'Light Blue' },
+ { color: '#008272', label: 'Teal'},
+ { color: '#107c10', label: 'Green'},
+ { color: '#bad80a', label: 'Light Green' },
+ { color: '#eaeaea'},
+ { color: 'black', label: 'Black'},
+ { color: '#333333', label: 'Neutral'},
+ { color: 'rgba(102, 102, 102, 0.5)', label: 'Half Gray' }
+ ],
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ key: 'colorFieldId'
+})
+
The PropertyFieldColorPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
selectedColor | +string or IColor | +no | +The CSS-compatible string or an IColor object to describe the initial color | +
color | +IPropertyFieldSwatchColorOption[] | +yes | +The color choices (color can be any CSS-Compatible string, labels are optional and will be shown as a tooltip on the swatch) | +
showAsCircles | +boolean | +no | +When true, color cells are shown as circles. When false (default), color cells are shown as squares | +
columnCount | +number | +no | +The number of cells to show per row (defaults to 6, minimum of 1 and maximum of 8) | +
style | +PropertyFieldSwatchColorPickerStyle | +no | +Determines how the control is displayed (defaults to inline) | +
iconName | +string | +no | +The name of the UI Fabric Font Icon to use for Inline display (defaults to Color) | +
valueAsObject | +boolean | +no | +When true, the property is returned as an IColor object. When false (default), the property is returned as a CSS-compatible string | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
Enum PropertyFieldSwatchColorPickerStyle
Name | +Description | +
---|---|
Full | +Display the full control in the property pane | +
Inline | +Display the color picker inline | +
By default, the Swatch Color Picker returns the value as a CSS-compatible string. This allows you the flexibility of simply assigning the value to an inline style as is and this is usually sufficient. However, this also limits the information directly available to you since the format could be a Hex code, an RGBA value, or even a named color and may not be suitable for advanced scenarios.
+By setting the valueAsObject
property to true, you will always receive a consistent IColor object that provides you detailed information about the chosen color. Here are the properties available in the IColor object:
Property | +Type | +Description | +
---|---|---|
str | +string | +CSS-compatible string (this is the same value that would normally be returned when valueAsObject is false) |
+
hex | +string | +Hex value (does not reflect alpha) | +
r | +number | +Red | +
g | +number | +Green | +
b | +number | +Blue | +
h | +number | +Hue | +
s | +number | +Saturation | +
v | +number | +Value | +
This control generates a team picker that can be used in the property pane of your SharePoint Framework web parts.
+Searching for teams
+ +Selected teams
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.config/package-solution.json
:{
+ "solution": {
+ "webApiPermissionRequests": [
+ {
+ "resource": "Microsoft Graph",
+ "scope": "Team.ReadBasic.All"
+ }, {
+ "resource": "Microsoft Graph",
+ "scope": "Files.Read"
+ }]
+ }
+}
+
Note
+Team.ReadBasic.All
and Files.Read
is a minimum set of permissions needed for the component. For other options please see List Joined Teams and Get Drive documentation.
import { PropertyFieldSitePicker } from '@pnp/spfx-property-controls/lib/PropertyFieldSitePicker';
+
import { IPropertyFieldTeam } from '../../PropertyFieldTeamPicker';
+
+export interface IPropertyControlsTestWebPartProps {
+ teams: IPropertyFieldTeam[];
+}
+
groupFields
of the web part property pane configuration:PropertyFieldTeamPicker('teams', {
+ key: 'teamsPicker',
+ context: this.context,
+ label: 'Select teams',
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ initialTeams: this.properties.teams,
+ multiSelect: true
+})
+
The PropertyFieldTeamPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
initialTeams | +IPropertyFieldTeam[] | +no | +Initial teams to load in the site picker (optional). | +
multiSelect | +boolean | +no | +Define if you want to allow multiple teams selection. (optional, false by default). | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the teams get changed. |
+
properties | +any | +yes | +Parent web part properties, this object is used to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
Interface IPropertyFieldTeam
Property | +Type | +Required | +Description | +
---|---|---|---|
id | +string | +no | +The ID of the team (group) | +
title | +string | +no | +Teams's display name | +
url | +string | +no | +URL to the underlying site | +
This control generates a term picker that can be used in the property pane of your SharePoint Framework web parts.
+++Disclaimer: This control makes use of the
+ProcessQuery
API end-points to retrieve the managed metadata information. This will get changed once the APIs for managing managed metadata will become available.
Empty term picker
+ +Selecting terms
+ +Selected terms in the panel
+ +Empty term picker
+ +Term picker: Auto Complete
+ +Limit the term set to a specific group or termset
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldTermPicker } from '@pnp/spfx-property-controls/lib/PropertyFieldTermPicker';
+
import { IPickerTerms } from "@pnp/spfx-property-controls/lib/PropertyFieldTermPicker";
+
+export interface IPropertyControlsTestWebPartProps {
+ terms: IPickerTerms;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldTermPicker('terms', {
+ label: 'Select terms',
+ panelTitle: 'Select terms',
+ initialValues: this.properties.terms,
+ allowMultipleSelections: true,
+ excludeSystemGroup: false,
+ onPropertyChange: this.onPropertyPaneFieldChanged,
+ properties: this.properties,
+ context: this.context,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ limitByGroupNameOrID: 'People',
+ limitByTermsetNameOrID: 'Location',
+ key: 'termSetsPickerFieldId'
+})
+
The PropertyFieldTermPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
panelTitle | +string | +yes | +TermSet Picker Panel title. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
initialValues | +IPickerTerms | +no | +Defines the selected by default term sets. | +
allowMultipleSelections | +boolean | +no | +Defines if the user can select only one or many term sets. Default value is false. | +
excludeSystemGroup | +boolean | +no | +Indicator to define if the system Groups are exclude. Default is false. | +
limitByGroupNameOrID | +string | +no | +Limit the term sets that can be used by the group name or ID. | +
limitByTermsetNameOrID | +string | +no | +Limit the terms that can be picked by the Term Set name or ID. | +
hideTermStoreName | +boolean | +no | +Specifies if you want to show or hide the term store name from the panel. | +
isTermSetSelectable | +boolean | +no | +Specify if the term set itself is selectable in the tree view. | +
areTermsSelectable | +boolean | +no | +Specify if the terms are selectable in the tree view. Default value is true |
+
areTermsHidden | +boolean | +no | +Specify if the terms are hidden from the tree view. | +
disabledTermIds | +string[] | +no | +Specify which terms should be disabled in the term set so that they cannot be selected. | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
resolveDelay | +number | +no | +The delay time in ms before resolving suggestions, which is kicked off when input has been changed. e.g. if a second input change happens within the resolveDelay time, the timer will start over. Only until after the timer completes will onResolveSuggestions be called. Default is 500. | +
anchorId | +string | +no | +When using LimitByTermsetNameOrId, set the anchorid to a child term in the TermSet to be able to select terms from that level and below. | +
Interface IPickerTerms
Property | +Type | +Required | +Description | +
---|---|---|---|
key | +string | +yes | +The ID of the term | +
name | +string | +yes | +The name of the term | +
path | +string | +yes | +The path of the term | +
termSet | +string | +yes | +The Id of the parent term set of the term | +
termSetName | +string | +no | +The Name of the parent term set of the term | +
PropertyFieldEnterpriseTermPicker
is implemented to be used for "enterprise" Term Stores with large amount of groups, terms sets, and terms. It loads term sets and terms on demand - only at the moment when specified group or term set has been expanded in the Term Store Tree.
+To implement on-demand loading PropertyFieldEnterpriseTermPicker
uses @pnp/sp-taxonomy
module from @pnp/pnpjs
library. It increases the size of a bundle when the control is used.
+Additionally, PropertyFieldEnterpriseTermPicker
allows to request labels for the terms in the picker.
PropertyFieldTermPicker
loads all the groups and term sets from the term service during the initial request. This approach fits most of the scenarios with small and medium number of objects in a term store. Besides that, PropertyFieldTermPicker
does not use any additional libraries or modules to retrieve data from the taxonomy service which makes it much more lightweight option in comparison with PropertyFieldEnterpriseTermPicker
. See PropertyFieldTermPicker for implementation details.
We recommend to use PropertyFieldTermPicker
control if you don't need on-demand loading or term labels.
This control generates a text field control with a callout.
+PropertyFieldTextWithCallout rendering
+ +PropertyFieldTextWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/PropertyFieldHeader';
+import { PropertyFieldTextWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldTextWithCallout';
+
export interface IPropertyControlsTestWebPartProps {
+ textInfoHeaderValue: string;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldTextWithCallout('textInfoHeaderValue', {
+ calloutTrigger: CalloutTriggers.Hover,
+ key: 'textInfoHeaderFieldId',
+ label: 'Describe your PnP passion with few words',
+ calloutContent: React.createElement('span', {}, 'You can describe your passion with such words as strong, cosmic, all-absorbing, etc.'),
+ calloutWidth: 150,
+ value: this.properties.textInfoHeaderValue
+})
+
The PropertyFieldTextWithCallout
control uses the same implementation as the default PropertyPaneTextField
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a toggle control with a callout.
+PropertyFieldToggleWithCallout rendering
+ +PropertyFieldToggleWithCallout callout opened
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/PropertyFieldHeader';
+import { PropertyFieldToggleWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldToggleWithCallout';
+
export interface IPropertyControlsTestWebPartProps {
+ toggleInfoHeaderValue: boolean;
+}
+
groupFields
of the web part property pane configuration:PropertyFieldToggleWithCallout('toggleInfoHeaderValue', {
+ calloutTrigger: CalloutTriggers.Click,
+ key: 'toggleInfoHeaderFieldId',
+ label: 'Turn on the PnP feature',
+ calloutContent: React.createElement('p', {}, 'With this control you can enable or disable the PnP features in your web part'),
+ onText: 'ON',
+ offText: 'OFF',
+ checked: this.properties.toggleInfoHeaderValue
+})
+
The PropertyFieldToggleWithCallout
control uses the same implementation as the default PropertyPaneToggle
and has the following additional properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
calloutContent | +React.ReactNode | +no | +Callout content - any HTML | +
calloutWidth | +number | +no | +Custom width for callout including borders. If value is 0, no width is applied. | +
calloutTrigger | +CalloutTriggers | +no | +Event to show the callout | +
gapSpace | +number | +no | +The gap between the callout and the target | +
Enum CalloutTriggers
Name | +Description | +
---|---|
Click | +Shows the callout when you hover over the icon | +
Hover | +Shows the callout when you click on the icon | +
This control generates a view picker field that can be used in the property pane of your SharePoint Framework web parts.
+The control automatically retrieves the views for a given SharePoint list:
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyFieldViewPicker, PropertyFieldViewPickerOrderBy } from '@pnp/spfx-property-controls/lib/PropertyFieldViewPicker';
+
multiSelect
prop to false
, as this control is designed to work with a single list. Store the list id in your web part properties, as follows:export interface IPropertyControlsTestWebPartProps {
+ list: string; // Stores the list ID
+}
+
BEGIN:
and END:
comments below:export interface IPropertyControlsTestWebPartProps {
+ list: string; // Stores the list ID
+
+ // BEGIN: Added
+ view: string; // Stores the view ID
+ // END: Added
+}
+
groupFields
of the web part property pane configuration:PropertyFieldViewPicker('view', {
+ label: 'Select a view',
+ listId: this.properties.list,
+ selectedView: this.properties.view,
+ orderBy: PropertyFieldViewPickerOrderBy.Title,
+ disabled: false,
+ onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
+ properties: this.properties,
+ context: this.context,
+ onGetErrorMessage: null,
+ deferredValidationTime: 0,
+ key: 'viewPickerFieldId'
+})
+
The PropertyFieldViewPicker
control can be configured with the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
label | +string | +yes | +Property field label displayed on top. | +
listId | +string | +yes | +The ID of the list or library you wish to select a view from. | +
disabled | +boolean | +no | +Specify if the control needs to be disabled. | +
context | +BaseComponentContext | +yes | +Context of the current web part. | +
selectedView | +string | +no | +Initial selected view of the control. | +
orderBy | +PropertyFieldViewPickerOrderBy | +no | +Specify the property on which you want to order the retrieve set of views. | +
webAbsoluteUrl | +string | +no | +Absolute Web Url of target site (user requires permissions) | +
onPropertyChange | +function | +yes | +Defines a onPropertyChange function to raise when the date gets changed. | +
properties | +any | +yes | +Parent web part properties, this object is use to update the property value. | +
key | +string | +yes | +An unique key that indicates the identity of this control. | +
onGetErrorMessage | +function | +no | +The method is used to get the validation error message and determine whether the input value is valid or not. See this documentation to learn how to use it. | +
deferredValidationTime | +number | +no | +Control will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200. |
+
viewsToExclude | +string[] | +no | +Defines views by which should be excluded from the view picker control. You can specify view titles or IDs | +
filter | +string | +no | +Filter views from OData query. | +
onViewsRetrieved | +(views: ISPView[]) => PromiseLike |
+no | +Callback that is called before the dropdown is populated. | +
Enum PropertyFieldViewPickerOrderBy
Name | +Description | +
---|---|
Id | +Sort by view ID | +
Title | +Sort by view title | +
This control allows you to embed content in a property pane using Markdown content.
+You can use this control to easily provide guidance for your users and create other content that is not easily created otherwise.
+It supports any arbitrary HTML without using dangerouslySetInnerHTML
, and allows overriding any HTML tag.
PropertyPaneMarkdownContent rendering
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyPaneMarkdownContent } from '@pnp/spfx-property-controls/lib/PropertyPaneMarkdownContent';
+
const md: string = `
+### This is Markdown
+
+[Markdown](http://daringfireball.net/projects/markdown/) lets you write content in a really natural way.
+
+ * You can have lists, like this one
+ * Make things **bold** or *italic*
+ * Embed snippets of \`code\`
+ * Create [links](/)
+ * ...
+
+Also supports GitHub-flavored Markdown checklists
+
+- [x] Checklist item 1
+- [x] Checklist item 2
+- [ ] Checklist item 3
+
+<small>Sample content borrowed with thanks from [markdown-to-jsx](https://probablyup.com/markdown-to-jsx/) ❤️</small>`
+
groupFields
of the web part property pane configuration:PropertyPaneMarkdownContent({
+ markdown: md,
+ key: 'markdownSample'
+})
+
Pay close attention to the indentation in your Markdown string. The Markdown parser assumes that four spaces preceding your content means a code block. This means that the following Markdown will render most of the content a code block:
+const md: string = `
+ To get started select an items from the library.
+
+ You can pick any items from the list, provided that is has a valid \`id\` attribute.`
+
Producing the following HTML:
+ +To solve this issue, make sure that your content is not indented.
+const md: string = `To get started select an items from the library.
+
+You can pick any items from the list, provided that is has a valid \`id\` attribute.`
+
Which will produce the following HTML: +
+You can override the rendering of any HTML element by specifying an overrides
prop to the options
.
For example, to override the CSS class of H3
elements (which is defined by a ###
in Markdown), you can override the className
attribute using the following code:
PropertyPaneMarkdownContent({
+ markdown: `
+### This is a heading 3
+
+You can override any HTML you want`,
+ key: 'markdownSample',
+ options: {
+ overrides: {
+ h3: { // Markdown equivalent of ###
+ props: {
+ className: "ms-font-xl ms-fontColor-neutralDark",
+ },
+ },
+ }
+ }}),
+
You can also render your own React elements using the overrides
prop. For example, if you have a MyCustomControl
React element, you can use the following:
// Import your React element
+import MyCustomControl from 'MyCustomControl';
+
+...
+
+PropertyPaneMarkdownContent({
+ markdown: `
+### This is a heading 3
+
+You can override any HTML you want
+
+<MyCustomControl sampleMessage='This is a sample message'/>
+`,
+ key: 'markdownSample',
+ options: {
+ overrides: {
+ h3: { // Markdown equivalent of ###
+ props: {
+ className: "ms-font-xl ms-fontColor-neutralDark",
+ },
+ },
+ // Override the React element
+ MyCustomControl: MyCustomControl
+ }
+ }}),
+
By default, the control will attempt to determine whether the Markdown content should be wrapped in a <div>
, <p>
, or <span>
to render content as block or inline elements.
For example, the following Markdown will be rendered as inline content:
+This is an _inline_ element
+
And the following Markdown will be rendered as block content:
+## This is a block element
+
However, you can override rendering all HTML as block elements or inline elements by passing forceBlock: true
or forceInline: true
to the component's options
prop.
By default the control converts named html codes to their unicode character equivalents:
+&
'
>
<
"
If you need to extend this map of named codes and unicode characters, you can pass a list of additional html codes by using the namedCodesToUnicode
option as object with the code names needed as follows:
PropertyPaneMarkdownContent({
+ markdown: `
+One hundred is ≤ than one thousand, but is &ge than fifty.`,
+ key: 'markdownSample',
+ options: {
+ namedCodesToUnicode: {
+ le: '\u2264',
+ ge: '\u2265',
+ }
+ }}),
+
By default, the PropertyPaneMarkdownContent
control will parse raw HTML elements in your Markdown content and will attempt to render them.
For example, this Markdown string will render text between two horizontal rulers:
+<hr/>
+Text between rulers
+<hr/>
+
If you do not wish to render raw HTML from your Markdown, you can specify disableParsingRawHTML: true
, which will render the same Markdown as follows:
<hr/>
+Text between rulers
+<hr/>
+
The PropertyPaneMarkdownContent
control has the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
markdown | +string | +yes | +Markdown content you wish to display in the property pane | +
key | +string | +yes | +A unique identifier for the property pane control | +
options | +IMarkdownProps | +no | +Optional settings to control how Markdown content is rendered | +
Property | +Type | +Required | +Description | +
---|---|---|---|
disableParsingRawHTML | +Boolean | +no | +true disables parsing of raw HTML elements within Markdown. |
+
forceBlock | +Boolean | +no | +true forces rendering all input strings as blocks. |
+
forceInline | +Boolean | +no | +true forces rendering all input strings as inline elements. |
+
namedCodesToUnicode | +object[] | +no | +An array of objects to override named HTML codes to their unicode equivalents. | +
overrides | +object[] | +no | +An array of HTML elements to override during rendering. | +
This control uses the markdown-to-jsx component to render safe HTML. For more information and advanced settings, please refer to the markdown-to-jsx documentation
+ + + + + + + + + + +This control allows the user to edit the webpart properties in JSON. It can also be used to export properties of a webpart and later import them again to a similar webpart on a different page. If the user clicks 'export' a file named 'webpartproperties.json' is presented for download. The same file can be uploaded to a new instance of the same webpart on for instance another site or page.
+PropertyPanePropertyEditor rendering in property pane
+ +PropertyPanePropertyEditor rendering when expanded
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyPanePropertyEditor } from '@pnp/spfx-property-controls/lib/PropertyPanePropertyEditor';
+
export interface IPropertyControlsTestWebPartProps {
+ toggleInfoHeaderValue: boolean;
+}
+
groupFields
of the web part property pane configuration:PropertyPanePropertyEditor({
+ webpart: this,
+ key: 'propertyEditor'
+})
+
The PropertyEditor
control has the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
webpart | +BaseClientSideWebPart | +yes | +The webpart, which is in principle the current webpart, of which you want to be able to edit the properties from | +
This control allows you to specify a description, a 'read more' link, and an optional embedded video
+PropertyPaneWebPartInformation rendering
+ +@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyPaneWebPartInformation } from '@pnp/spfx-property-controls/lib/PropertyPaneWebPartInformation';
+
export interface IPropertyControlsTestWebPartProps {
+ toggleInfoHeaderValue: boolean;
+}
+
groupFields
of the web part property pane configuration:PropertyPaneWebPartInformation({
+ description: `This is a <strong>demo webpart</strong>, used to demonstrate all the <a href="https://aka.ms/sppnp">PnP</a> property controls`,
+ moreInfoLink: `https://pnp.github.io/sp-dev-fx-property-controls/`,
+ videoProperties: {
+ embedLink: `https://www.youtube.com/embed/d_9o3tQ90zo`,
+ properties: { allowFullScreen: true}
+ },
+ key: 'webPartInfoId'
+})
+
The PropertyPaneWebPartInformation
control has the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
description | +string | +yes | +Description content - any HTML | +
moreInfoLink | +string | +no | +A URL providing optional additional information | +
moreInfoLinkTarget | +string | +no | +An optional target for the link. Defaults to '_blank' | +
videoProperties | +IVideoEmbedProperties | +no | +A video properties object specifying an optionally embedded video | +
Class IVideoEmbedProperties
Property | +Type | +Required | +Description | +
---|---|---|---|
embedLink | +string | +yes | +A link to an embeddable video. The video will be embedded in an iframe. See the example above for details | +
width | +number | +no | +optional width of the iframe | +
height | +number | +no | +optional height of the iframe | +
properties | +object | +no | +additional properties to set on the iframe element | +
To get started you have to install the following dependency to your project: @pnp/spfx-property-controls
.
Enter the following command to install the dependency to your project:
+npm install @pnp/spfx-property-controls --save --save-exact
+
Once the package is installed, you will have to configure the resource file of the property controls to be used in your project. You can do this by opening the config/config.json
and adding the following line to the localizedResources
property:
"PropertyControlStrings": "./node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js"
+
Once you installed the dependency you can start using the controls in your solution. Go to the documentation homepage to get an overview of all the available controls: home.
+ + + + + + + + + + +We appreciate that you're interested in helping with moving the project forward. Before you submit your first PR, please read the following guide. We'd hate to see you work on something that someone else is already working on, something that we agreed not to do or something that doesn't match the project.
+Sharing is caring!
+Awesome! Good ideas are invaluable for every product. Before you start hacking away, please check if there is no similar idea already listed in the issue list. If not, please create a new issue describing your idea. Once we agree on the feature scope and architecture, the feature will be ready for building. Don't hesitate to mention in the issue if you'd like to build the feature yourself.
+When building a new control, try to add your control to the default provided web part so that everyone can test it out. Please also provide the documentation for your controls in the documentation section.
+Nothing is perfect. If you have an idea how to improve an existing control, let us know by submitting an issue in the issue list. Some things are done for a reason, but some are not. Let's discuss what you think and see how the project could be improved for everyone.
+Bugs happen. When you find a bug, please have a look at the issue list if a similar bug has already been logged. If not, let us know what doesn't work and how we can reproduce it. If we can't reproduce your bug, we will ask you for clarification, which will only make it longer to fix it.
+Typos are embarrassing! Most PR's that fix typos will be accepted immediately. In order to make it easier to review the PR, please narrow the focus instead of sending a huge PR of fixes.
+Before contributing:
+ensure that the dev branch on your fork is in sync with the original sp-dev-fx-property-controls repository + ```sh + # assuming you are in the folder of your locally cloned fork.... + git checkout dev
+upstream
pointing to the official sp-dev-fx-property-controls repo¶git fetch upstream
+git pull --rebase upstream dev +```
+create a feature branch for your change. If you'll get stuck on an issue or merging your PR will take a while, this will allow you to have a clean dev branch that you can use for contributing other changes
+ sh
+ git checkout -b my-contribution
Following is an overview of guides for this project. If you're considering contributing to the project, reading up on these guides will help you understand the project structure and get started developing for it.
+Most of the controls have no breaking changes when moving from v1 to v2. However, some APIs were changed to make the library more stable and controls behavior more even.
+Also, we've bumped up React and Fluent UI versions used in the library. It means you will need to update package.json
file in your SPFx projects.
The below guide is an overview of what it takes to migrate from v1 to v2. If we missed something, please let us know in the issues list so we can update the guide. Thanks!
+v2 of Reusable Controls is based on SharePoint Framework 1.11 and, as a result, does not support SharePoint on-premises.
+++Important: Please, use v1 if you plan to deploy your solution on-premises.
+
v2 of Reusable Controls uses React.js v16.8.5 and Fluent UI (Office UI Fabric React) v6.214.0.
+Although it is not necessary to use the same modules' versions in your project, we highly recommend to update your solution accordingly:
+"dependencies": {
+ // other dependencies
+ "office-ui-fabric-react": "6.214.0",
+ "react": "16.8.5",
+ "react-dom": "16.8.5"
+ },
+ "devDependencies": {
+ "@types/react": "16.8.8",
+ "@types/react-dom": "16.8.3",
+ },
+
The easiest way to upgrade SharePoint Framework solution is to use Office365 CLI spfx project upgrade
command.
...
+ + + + + + + + + + +The shortest way to prepare your local copy of the project for development and testing.
+Before you start contributing to this project, you will need Node.js. This project has been tested with the 10.x version of Node.js and the version of NPM that comes with it. You can use Node Version Manager to switch between different versions of Node.js.
+npm install
to restore dependenciesgulp serve
to serve your projectSharePoint Framework Property Controls uses MkDocs to publish documentation pages. See more information about installing MkDocs on your operating system at http://www.mkdocs.org/#installation.
+Also, documentation uses custom MkDocs theme that should be installed as well. See Material theme for MkDocs
+Once you have MkDocs and Material theme installed on your machine, in the command line:
+cd ./docs/documentation
to change directory to where the manual pages are storedmkdocs serve
to start the local web server with MkDocs and view the documentation in the web browserWe appreciate your initiative and would love to integrate your work with the rest of the project! Here is how you can help us do it as quickly as possible.
+Looking for a quick cheat sheet? Look no further:
+```sh
+git checkout dev
+upstream
pointing to the official sp-dev-fx-property-controls repo¶git fetch upstream
+git pull --rebase upstream dev
+git checkout issue-xyz
+git rebase dev
+``
+- submit PR to the **dev** branch of the main repo. PRs submitted to other branches will be declined
+- let us know what's in the PR: is it a new command, bug fix or a minor update in the docs? The clearer the information you provide, the quicker your PR can be verified and merged
+- ideally 1 PR = 1 commit - this makes it easier to keep the log clear for everyone and track what's changed. If you're new to working with git, we'll squash your commits for you when merging your changes into the main repo
+- don't worry about changing the version or adding yourself to the list of contributors in
package.json`. We'll do that for you when merging your changes.
These are helpers to interact with the property pane of the web part. Currently this helper allows you to show a spinner when the property pane is loading resources. This could be loading controls, fetching data, ... Normally you would get a white property pane until all data is loaded.
+@pnp/spfx-property-controls
dependency. Check out The getting started page for more information about installing the dependency.import { PropertyPaneHelpers } from '@pnp/spfx-property-controls/lib/helpers';
+
/**
+ * Load property pane resources
+ */
+protected async loadPropertyPaneResources(): Promise<void> {
+ PropertyPaneHelpers.setSpinner({
+ bgColor: "white",
+ spinnerProps: {
+ styles: () => {
+ return {
+ circle: {
+ height: 80,
+ width: 80
+ }
+ };
+ }
+ }
+ });
+
+ // Write here the code you want to add to load your resources
+
+ PropertyPaneHelpers.clearSpinner(200);
+}
+
The setSpinner
method allows you to set the following properties:
Property | +Type | +Required | +Description | +
---|---|---|---|
bgColor | +string | +no | +Spinner background color | +
className | +string | +no | +Class name to style the spinner yourself. | +
spinnerProps | +ISpinnerProps | +no | +Spinner properties from Office UI Fabric. | +
This repository provides developers with a set of reusable property pane controls that can be used in their SharePoint Framework (SPFx) solutions.
+Attention
+In order to migrate to v2
and v3
from v1
it is advised to follow this guide: Migrating from V1.
Currently there are 3 active versions of the controls. Please, reference the table below to see what version to use in your project.
+Version | +SPFx minimal dependency | +Fluent UI (Office UI Fabric React) version | +SharePoint Version | +Comments | +
---|---|---|---|---|
v3 |
+1.13.* |
+7.174.1 |
+Online | +The most current, actively maintained version of the library. | +
v2 |
+1.11.0 |
+6.214.0 |
+Online | +The version deprecated and not actively maintained. We strongly recommend to update to SPFx 1.13.* and v3 of Controls. |
+
v1 |
+1.3.0 |
+5.131.0 |
+On-Prem | +The version is maintained for SharePoint On-Prem 2016 and 2019 implementations. Be aware that the controls might not work in solutions you're building for on-premises. As for on-premises solutions version 1.1.0 will get used. |
+
Attention
+If you are using v3
of the Controls with SPFx 1.12.1
you will need to cast web part context to any
to pass it to the controls.
To get started you have to install the following dependency to your project: @pnp/spfx-property-controls
.
Enter the following command to install the dependency to your project:
+npm install @pnp/spfx-property-controls --save --save-exact
+
Note
+Since v1.7.0
the localized resource path will automatically be configured during the dependency installing.
Once the package is installed, you will have to configure the resource file of the property controls to be used in your project. You can do this by opening the config/config.json
and adding the following line to the localizedResources
property:
"PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js"
+
All controls gather telemetry to verify the usage. Only the name of the control and related data gets captured.
+++More information about the service that we are using for this can be found here: PnP Telemetry Proxy.
+
Since version 1.17.0
it is possible to opt-out of the telemetry by adding the following code to your web part:
import PnPTelemetry from "@pnp/telemetry-js";
+...
+const telemetry = PnPTelemetry.getInstance();
+telemetry.optOut();
+
The following controls are currently available:
+The following controls are extended controls that show a callout next to the label
+ , or to render content as block or inline elements. For example, the following Markdown will be rendered as inline content: This is an _inline_ element And the following Markdown will be rendered as block content: ## This is a block element However, you can override rendering all HTML as block elements or inline elements by passing forceBlock: true or forceInline: true to the component's options prop. Named unicode \u00b6 By default the control converts named html codes to their unicode character equivalents: &: & ': ' >: > <: < (space) : \": " If you need to extend this map of named codes and unicode characters, you can pass a list of additional html codes by using the namedCodesToUnicode option as object with the code names needed as follows: PropertyPaneMarkdownContent ({ markdown : ` One hundred is ≤ than one thousand, but is &ge than fifty.` , key : 'markdownSample' , options : { namedCodesToUnicode : { le : '\\u2264' , ge : '\\u2265' , } }}), Disabling parsing raw HTML \u00b6 By default, the PropertyPaneMarkdownContent control will parse raw HTML elements in your Markdown content and will attempt to render them. For example, this Markdown string will render text between two horizontal rulers: , or to render content as block or inline elements. For example, the following Markdown will be rendered as inline content: This is an _inline_ element And the following Markdown will be rendered as block content: ## This is a block element However, you can override rendering all HTML as block elements or inline elements by passing forceBlock: true or forceInline: true to the component's options prop.","title":"Rendering all elements as inline or block elements"},{"location":"controls/PropertyPaneMarkdownContent/#named-unicode","text":"By default the control converts named html codes to their unicode character equivalents: &: & ': ' >: > <: < (space) : \": " If you need to extend this map of named codes and unicode characters, you can pass a list of additional html codes by using the namedCodesToUnicode option as object with the code names needed as follows: PropertyPaneMarkdownContent ({ markdown : ` One hundred is ≤ than one thousand, but is &ge than fifty.` , key : 'markdownSample' , options : { namedCodesToUnicode : { le : '\\u2264' , ge : '\\u2265' , } }}),","title":"Named unicode"},{"location":"controls/PropertyPaneMarkdownContent/#disabling-parsing-raw-html","text":"By default, the PropertyPaneMarkdownContent control will parse raw HTML elements in your Markdown content and will attempt to render them. For example, this Markdown string will render text between two horizontal rulers:
Text between rulers
If you do not wish to render raw HTML from your Markdown, you can specify disableParsingRawHTML: true , which will render the same Markdown as follows: < hr/ > Text between rulers < hr/ > Implementation \u00b6 PropertyPaneMarkdownContent \u00b6 The PropertyPaneMarkdownContent control has the following properties: Property Type Required Description markdown string yes Markdown content you wish to display in the property pane key string yes A unique identifier for the property pane control options IMarkdownProps no Optional settings to control how Markdown content is rendered IMarkdownProps \u00b6 Property Type Required Description disableParsingRawHTML Boolean no true disables parsing of raw HTML elements within Markdown. forceBlock Boolean no true forces rendering all input strings as blocks. forceInline Boolean no true forces rendering all input strings as inline elements. namedCodesToUnicode object[] no An array of objects to override named HTML codes to their unicode equivalents. overrides object[] no An array of HTML elements to override during rendering. This control uses the markdown-to-jsx component to render safe HTML. For more information and advanced settings, please refer to the markdown-to-jsx documentation","title":"PropertyPaneMarkdownContent"},{"location":"controls/PropertyPaneMarkdownContent/#propertypanemarkdowncontent-control","text":"This control allows you to embed content in a property pane using Markdown content. You can use this control to easily provide guidance for your users and create other content that is not easily created otherwise. It supports any arbitrary HTML without using dangerouslySetInnerHTML , and allows overriding any HTML tag. PropertyPaneMarkdownContent rendering","title":"PropertyPaneMarkdownContent control"},{"location":"controls/PropertyPaneMarkdownContent/#how-to-use-this-control-in-your-solutions","text":"Check that you installed the @pnp/spfx-property-controls dependency. Check out The getting started page for more information about installing the dependency. Import the following modules to your component: import { PropertyPaneMarkdownContent } from '@pnp/spfx-property-controls/lib/PropertyPaneMarkdownContent' ; Create a string with Markdown content for your property pane, for example: const md : string = ` ### This is Markdown [Markdown](http://daringfireball.net/projects/markdown/) lets you write content in a really natural way. * You can have lists, like this one * Make things **bold** or *italic* * Embed snippets of \\`code\\` * Create [links](/) * ... Also supports GitHub-flavored Markdown checklists - [x] Checklist item 1 - [x] Checklist item 2 - [ ] Checklist item 3 Sample content borrowed with thanks from [markdown-to-jsx](https://probablyup.com/markdown-to-jsx/) \u2764\ufe0f` Add the custom property control to the groupFields of the web part property pane configuration: PropertyPaneMarkdownContent ({ markdown : md , key : 'markdownSample' })","title":"How to use this control in your solutions"},{"location":"controls/PropertyPaneMarkdownContent/#indentation","text":"Pay close attention to the indentation in your Markdown string. The Markdown parser assumes that four spaces preceding your content means a code block. This means that the following Markdown will render most of the content a code block: const md : string = ` To get started select an items from the library. You can pick any items from the list, provided that is has a valid \\`id\\` attribute.` Producing the following HTML: To solve this issue, make sure that your content is not indented. const md : string = `To get started select an items from the library. You can pick any items from the list, provided that is has a valid \\`id\\` attribute.` Which will produce the following HTML:","title":"Indentation"},{"location":"controls/PropertyPaneMarkdownContent/#overriding-rendering-of-html-elements","text":"You can override the rendering of any HTML element by specifying an overrides prop to the options . For example, to override the CSS class of H3 elements (which is defined by a ### in Markdown), you can override the className attribute using the following code: PropertyPaneMarkdownContent ({ markdown : ` ### This is a heading 3 You can override any HTML you want` , key : 'markdownSample' , options : { overrides : { h3 : { // Markdown equivalent of ### props : { className : \"ms-font-xl ms-fontColor-neutralDark\" , }, }, } }}), You can also render your own React elements using the overrides prop. For example, if you have a MyCustomControl React element, you can use the following: // Import your React element import MyCustomControl from 'MyCustomControl' ; ... PropertyPaneMarkdownContent ({ markdown : ` ### This is a heading 3 You can override any HTML you want
Text between rulers
If you do not wish to render raw HTML from your Markdown, you can specify disableParsingRawHTML: true , which will render the same Markdown as follows: < hr/ > Text between rulers < hr/ >","title":"Disabling parsing raw HTML"},{"location":"controls/PropertyPaneMarkdownContent/#implementation","text":"","title":"Implementation"},{"location":"controls/PropertyPaneMarkdownContent/#propertypanemarkdowncontent","text":"The PropertyPaneMarkdownContent control has the following properties: Property Type Required Description markdown string yes Markdown content you wish to display in the property pane key string yes A unique identifier for the property pane control options IMarkdownProps no Optional settings to control how Markdown content is rendered","title":"PropertyPaneMarkdownContent"},{"location":"controls/PropertyPaneMarkdownContent/#imarkdownprops","text":"Property Type Required Description disableParsingRawHTML Boolean no true disables parsing of raw HTML elements within Markdown. forceBlock Boolean no true forces rendering all input strings as blocks. forceInline Boolean no true forces rendering all input strings as inline elements. namedCodesToUnicode object[] no An array of objects to override named HTML codes to their unicode equivalents. overrides object[] no An array of HTML elements to override during rendering. This control uses the markdown-to-jsx component to render safe HTML. For more information and advanced settings, please refer to the markdown-to-jsx documentation","title":"IMarkdownProps"},{"location":"controls/PropertyPanePropertyEditor/","text":"PropertyPanePropertyEditor control \u00b6 This control allows the user to edit the webpart properties in JSON. It can also be used to export properties of a webpart and later import them again to a similar webpart on a different page. If the user clicks 'export' a file named 'webpartproperties.json' is presented for download. The same file can be uploaded to a new instance of the same webpart on for instance another site or page. PropertyPanePropertyEditor rendering in property pane PropertyPanePropertyEditor rendering when expanded How to use this control in your solutions \u00b6 Check that you installed the @pnp/spfx-property-controls dependency. Check out The getting started page for more information about installing the dependency. Import the following modules to your component: import { PropertyPanePropertyEditor } from '@pnp/spfx-property-controls/lib/PropertyPanePropertyEditor' ; Create a new property for your web part, for example: export interface IPropertyControlsTestWebPartProps { toggleInfoHeaderValue : boolean ; } Add the custom property control to the groupFields of the web part property pane configuration: PropertyPanePropertyEditor ({ webpart : this , key : 'propertyEditor' }) Implementation \u00b6 The PropertyEditor control has the following properties: Property Type Required Description webpart BaseClientSideWebPart yes The webpart, which is in principle the current webpart, of which you want to be able to edit the properties from","title":"PropertyPanePropertyEditor"},{"location":"controls/PropertyPanePropertyEditor/#propertypanepropertyeditor-control","text":"This control allows the user to edit the webpart properties in JSON. It can also be used to export properties of a webpart and later import them again to a similar webpart on a different page. If the user clicks 'export' a file named 'webpartproperties.json' is presented for download. The same file can be uploaded to a new instance of the same webpart on for instance another site or page. PropertyPanePropertyEditor rendering in property pane PropertyPanePropertyEditor rendering when expanded","title":"PropertyPanePropertyEditor control"},{"location":"controls/PropertyPanePropertyEditor/#how-to-use-this-control-in-your-solutions","text":"Check that you installed the @pnp/spfx-property-controls dependency. Check out The getting started page for more information about installing the dependency. Import the following modules to your component: import { PropertyPanePropertyEditor } from '@pnp/spfx-property-controls/lib/PropertyPanePropertyEditor' ; Create a new property for your web part, for example: export interface IPropertyControlsTestWebPartProps { toggleInfoHeaderValue : boolean ; } Add the custom property control to the groupFields of the web part property pane configuration: PropertyPanePropertyEditor ({ webpart : this , key : 'propertyEditor' })","title":"How to use this control in your solutions"},{"location":"controls/PropertyPanePropertyEditor/#implementation","text":"The PropertyEditor control has the following properties: Property Type Required Description webpart BaseClientSideWebPart yes The webpart, which is in principle the current webpart, of which you want to be able to edit the properties from","title":"Implementation"},{"location":"controls/PropertyPaneWebPartInformation/","text":"PropertyPaneWebPartInformation control \u00b6 This control allows you to specify a description, a 'read more' link, and an optional embedded video PropertyPaneWebPartInformation rendering How to use this control in your solutions \u00b6 Check that you installed the @pnp/spfx-property-controls dependency. Check out The getting started page for more information about installing the dependency. Import the following modules to your component: import { PropertyPaneWebPartInformation } from '@pnp/spfx-property-controls/lib/PropertyPaneWebPartInformation' ; Create a new property for your web part, for example: export interface IPropertyControlsTestWebPartProps { toggleInfoHeaderValue : boolean ; } Add the custom property control to the groupFields of the web part property pane configuration: PropertyPaneWebPartInformation ({ description : `This is a demo webpart, used to demonstrate all the PnP property controls` , moreInfoLink : `https://pnp.github.io/sp-dev-fx-property-controls/` , videoProperties : { embedLink : `https://www.youtube.com/embed/d_9o3tQ90zo` , properties : { allowFullScreen : true } }, key : 'webPartInfoId' }) Implementation \u00b6 The PropertyPaneWebPartInformation control has the following properties: Property Type Required Description description string yes Description content - any HTML moreInfoLink string no A URL providing optional additional information moreInfoLinkTarget string no An optional target for the link. Defaults to '_blank' videoProperties IVideoEmbedProperties no A video properties object specifying an optionally embedded video Class IVideoEmbedProperties Property Type Required Description embedLink string yes A link to an embeddable video. The video will be embedded in an iframe. See the example above for details width number no optional width of the iframe height number no optional height of the iframe properties object no additional properties to set on the iframe element","title":"PropertyPaneWebPartInformation"},{"location":"controls/PropertyPaneWebPartInformation/#propertypanewebpartinformation-control","text":"This control allows you to specify a description, a 'read more' link, and an optional embedded video PropertyPaneWebPartInformation rendering","title":"PropertyPaneWebPartInformation control"},{"location":"controls/PropertyPaneWebPartInformation/#how-to-use-this-control-in-your-solutions","text":"Check that you installed the @pnp/spfx-property-controls dependency. Check out The getting started page for more information about installing the dependency. Import the following modules to your component: import { PropertyPaneWebPartInformation } from '@pnp/spfx-property-controls/lib/PropertyPaneWebPartInformation' ; Create a new property for your web part, for example: export interface IPropertyControlsTestWebPartProps { toggleInfoHeaderValue : boolean ; } Add the custom property control to the groupFields of the web part property pane configuration: PropertyPaneWebPartInformation ({ description : `This is a demo webpart, used to demonstrate all the PnP property controls` , moreInfoLink : `https://pnp.github.io/sp-dev-fx-property-controls/` , videoProperties : { embedLink : `https://www.youtube.com/embed/d_9o3tQ90zo` , properties : { allowFullScreen : true } }, key : 'webPartInfoId' })","title":"How to use this control in your solutions"},{"location":"controls/PropertyPaneWebPartInformation/#implementation","text":"The PropertyPaneWebPartInformation control has the following properties: Property Type Required Description description string yes Description content - any HTML moreInfoLink string no A URL providing optional additional information moreInfoLinkTarget string no An optional target for the link. Defaults to '_blank' videoProperties IVideoEmbedProperties no A video properties object specifying an optionally embedded video Class IVideoEmbedProperties Property Type Required Description embedLink string yes A link to an embeddable video. The video will be embedded in an iframe. See the example above for details width number no optional width of the iframe height number no optional height of the iframe properties object no additional properties to set on the iframe element","title":"Implementation"},{"location":"guides/","text":"Project guides \u00b6 Following is an overview of guides for this project. If you're considering contributing to the project, reading up on these guides will help you understand the project structure and get started developing for it. Contributing - how you can contribute to the project Minimal Path to Awesome - setup your development environment Submitting a PR - how to submit a PR Migrating from V1 - how to migrate from v1","title":"Project guides"},{"location":"guides/#project-guides","text":"Following is an overview of guides for this project. If you're considering contributing to the project, reading up on these guides will help you understand the project structure and get started developing for it. Contributing - how you can contribute to the project Minimal Path to Awesome - setup your development environment Submitting a PR - how to submit a PR Migrating from V1 - how to migrate from v1","title":"Project guides"},{"location":"guides/contributing/","text":"Contribution guidelines \u00b6 We appreciate that you're interested in helping with moving the project forward. Before you submit your first PR, please read the following guide. We'd hate to see you work on something that someone else is already working on, something that we agreed not to do or something that doesn't match the project. Sharing is caring! You have an idea for a new control \u00b6 Awesome! Good ideas are invaluable for every product. Before you start hacking away, please check if there is no similar idea already listed in the issue list . If not, please create a new issue describing your idea. Once we agree on the feature scope and architecture, the feature will be ready for building. Don't hesitate to mention in the issue if you'd like to build the feature yourself. When building a new control, try to add your control to the default provided web part so that everyone can test it out. Please also provide the documentation for your controls in the documentation section . You have a suggestion for improving an existing control \u00b6 Nothing is perfect. If you have an idea how to improve an existing control, let us know by submitting an issue in the issue list . Some things are done for a reason, but some are not. Let's discuss what you think and see how the project could be improved for everyone. You've found a bug \u00b6 Bugs happen. When you find a bug, please have a look at the issue list if a similar bug has already been logged. If not, let us know what doesn't work and how we can reproduce it. If we can't reproduce your bug, we will ask you for clarification, which will only make it longer to fix it. Fixing typos \u00b6 Typos are embarrassing! Most PR's that fix typos will be accepted immediately. In order to make it easier to review the PR, please narrow the focus instead of sending a huge PR of fixes. Tips \u00b6 Before contributing: ensure that the dev branch on your fork is in sync with the original sp-dev-fx-property-controls repository ```sh # assuming you are in the folder of your locally cloned fork.... git checkout dev assuming you have a remote named upstream pointing to the official sp-dev-fx-property-controls repo \u00b6 git fetch upstream update your local dev to be a mirror of what's in the main repo \u00b6 git pull --rebase upstream dev ``` create a feature branch for your change. If you'll get stuck on an issue or merging your PR will take a while, this will allow you to have a clean dev branch that you can use for contributing other changes sh git checkout -b my-contribution DO's & DON'Ts \u00b6 DO follow the same project and test structure as the existing project. DO include tests when adding new functionality and features. When fixing bugs, start with adding a test that highlights how the current behavior is broken. DO keep discussions focused. When a new or related topic comes up it's often better to create new issue than to side track the conversation. DO NOT submit PR's for coding style changes. DO NOT surprise us with big PR's. Instead file an issue & start a discussion so we can agree on a direction before you invest a large amount of time. DO NOT commit code you didn't write. DO NOT submit PR's that refactor existing code without a discussion first.","title":"Contribution guidelines"},{"location":"guides/contributing/#contribution-guidelines","text":"We appreciate that you're interested in helping with moving the project forward. Before you submit your first PR, please read the following guide. We'd hate to see you work on something that someone else is already working on, something that we agreed not to do or something that doesn't match the project. Sharing is caring!","title":"Contribution guidelines"},{"location":"guides/contributing/#you-have-an-idea-for-a-new-control","text":"Awesome! Good ideas are invaluable for every product. Before you start hacking away, please check if there is no similar idea already listed in the issue list . If not, please create a new issue describing your idea. Once we agree on the feature scope and architecture, the feature will be ready for building. Don't hesitate to mention in the issue if you'd like to build the feature yourself. When building a new control, try to add your control to the default provided web part so that everyone can test it out. Please also provide the documentation for your controls in the documentation section .","title":"You have an idea for a new control"},{"location":"guides/contributing/#you-have-a-suggestion-for-improving-an-existing-control","text":"Nothing is perfect. If you have an idea how to improve an existing control, let us know by submitting an issue in the issue list . Some things are done for a reason, but some are not. Let's discuss what you think and see how the project could be improved for everyone.","title":"You have a suggestion for improving an existing control"},{"location":"guides/contributing/#youve-found-a-bug","text":"Bugs happen. When you find a bug, please have a look at the issue list if a similar bug has already been logged. If not, let us know what doesn't work and how we can reproduce it. If we can't reproduce your bug, we will ask you for clarification, which will only make it longer to fix it.","title":"You've found a bug"},{"location":"guides/contributing/#fixing-typos","text":"Typos are embarrassing! Most PR's that fix typos will be accepted immediately. In order to make it easier to review the PR, please narrow the focus instead of sending a huge PR of fixes.","title":"Fixing typos"},{"location":"guides/contributing/#tips","text":"Before contributing: ensure that the dev branch on your fork is in sync with the original sp-dev-fx-property-controls repository ```sh # assuming you are in the folder of your locally cloned fork.... git checkout dev","title":"Tips"},{"location":"guides/contributing/#assuming-you-have-a-remote-named-upstream-pointing-to-the-official-sp-dev-fx-property-controls-repo","text":"git fetch upstream","title":"assuming you have a remote named upstream pointing to the official sp-dev-fx-property-controls repo"},{"location":"guides/contributing/#update-your-local-dev-to-be-a-mirror-of-whats-in-the-main-repo","text":"git pull --rebase upstream dev ``` create a feature branch for your change. If you'll get stuck on an issue or merging your PR will take a while, this will allow you to have a clean dev branch that you can use for contributing other changes sh git checkout -b my-contribution","title":"update your local dev to be a mirror of what's in the main repo"},{"location":"guides/contributing/#dos-donts","text":"DO follow the same project and test structure as the existing project. DO include tests when adding new functionality and features. When fixing bugs, start with adding a test that highlights how the current behavior is broken. DO keep discussions focused. When a new or related topic comes up it's often better to create new issue than to side track the conversation. DO NOT submit PR's for coding style changes. DO NOT surprise us with big PR's. Instead file an issue & start a discussion so we can agree on a direction before you invest a large amount of time. DO NOT commit code you didn't write. DO NOT submit PR's that refactor existing code without a discussion first.","title":"DO's & DON'Ts"},{"location":"guides/migrate-from-v1/","text":"Migrating from v1 to v2 \u00b6 Most of the controls have no breaking changes when moving from v1 to v2. However, some APIs were changed to make the library more stable and controls behavior more even. Also, we've bumped up React and Fluent UI versions used in the library. It means you will need to update package.json file in your SPFx projects. The below guide is an overview of what it takes to migrate from v1 to v2. If we missed something, please let us know in the issues list so we can update the guide. Thanks! v2 Supports SharePoint Online Only \u00b6 v2 of Reusable Controls is based on SharePoint Framework 1.11 and, as a result, does not support SharePoint on-premises. Important : Please, use v1 if you plan to deploy your solution on-premises. React and Fluent UI versions \u00b6 v2 of Reusable Controls uses React.js v16.8.5 and Fluent UI (Office UI Fabric React) v6.214.0. Although it is not necessary to use the same modules' versions in your project, we highly recommend to update your solution accordingly: \"dependencies\" : { // other dependencies \"office-ui-fabric-react\" : \"6.214.0\" , \"react\" : \"16.8.5\" , \"react-dom\" : \"16.8.5\" }, \"devDependencies\" : { \"@types/react\" : \"16.8.8\" , \"@types/react-dom\" : \"16.8.3\" , }, The easiest way to upgrade SharePoint Framework solution is to use Office365 CLI spfx project upgrade command. APIs Changes \u00b6 ...","title":"Migrating from v1 to v2"},{"location":"guides/migrate-from-v1/#migrating-from-v1-to-v2","text":"Most of the controls have no breaking changes when moving from v1 to v2. However, some APIs were changed to make the library more stable and controls behavior more even. Also, we've bumped up React and Fluent UI versions used in the library. It means you will need to update package.json file in your SPFx projects. The below guide is an overview of what it takes to migrate from v1 to v2. If we missed something, please let us know in the issues list so we can update the guide. Thanks!","title":"Migrating from v1 to v2"},{"location":"guides/migrate-from-v1/#v2-supports-sharepoint-online-only","text":"v2 of Reusable Controls is based on SharePoint Framework 1.11 and, as a result, does not support SharePoint on-premises. Important : Please, use v1 if you plan to deploy your solution on-premises.","title":"v2 Supports SharePoint Online Only"},{"location":"guides/migrate-from-v1/#react-and-fluent-ui-versions","text":"v2 of Reusable Controls uses React.js v16.8.5 and Fluent UI (Office UI Fabric React) v6.214.0. Although it is not necessary to use the same modules' versions in your project, we highly recommend to update your solution accordingly: \"dependencies\" : { // other dependencies \"office-ui-fabric-react\" : \"6.214.0\" , \"react\" : \"16.8.5\" , \"react-dom\" : \"16.8.5\" }, \"devDependencies\" : { \"@types/react\" : \"16.8.8\" , \"@types/react-dom\" : \"16.8.3\" , }, The easiest way to upgrade SharePoint Framework solution is to use Office365 CLI spfx project upgrade command.","title":"React and Fluent UI versions"},{"location":"guides/migrate-from-v1/#apis-changes","text":"...","title":"APIs Changes"},{"location":"guides/mpa/","text":"Minimal Path to Awesome \u00b6 The shortest way to prepare your local copy of the project for development and testing. Install prerequisites \u00b6 Before you start contributing to this project, you will need Node.js. This project has been tested with the 10.x version of Node.js and the version of NPM that comes with it. You can use Node Version Manager to switch between different versions of Node.js. Get the local version of the project \u00b6 fork this repository clone your fork in the command line: run npm install to restore dependencies run gulp serve to serve your project Start making your changes Documentation \u00b6 SharePoint Framework Property Controls uses MkDocs to publish documentation pages. See more information about installing MkDocs on your operating system at http://www.mkdocs.org/#installation. Also, documentation uses custom MkDocs theme that should be installed as well. See Material theme for MkDocs Once you have MkDocs and Material theme installed on your machine, in the command line: run cd ./docs/documentation to change directory to where the manual pages are stored run mkdocs serve to start the local web server with MkDocs and view the documentation in the web browser","title":"Minimal Path to Awesome"},{"location":"guides/mpa/#minimal-path-to-awesome","text":"The shortest way to prepare your local copy of the project for development and testing.","title":"Minimal Path to Awesome"},{"location":"guides/mpa/#install-prerequisites","text":"Before you start contributing to this project, you will need Node.js. This project has been tested with the 10.x version of Node.js and the version of NPM that comes with it. You can use Node Version Manager to switch between different versions of Node.js.","title":"Install prerequisites"},{"location":"guides/mpa/#get-the-local-version-of-the-project","text":"fork this repository clone your fork in the command line: run npm install to restore dependencies run gulp serve to serve your project Start making your changes","title":"Get the local version of the project"},{"location":"guides/mpa/#documentation","text":"SharePoint Framework Property Controls uses MkDocs to publish documentation pages. See more information about installing MkDocs on your operating system at http://www.mkdocs.org/#installation. Also, documentation uses custom MkDocs theme that should be installed as well. See Material theme for MkDocs Once you have MkDocs and Material theme installed on your machine, in the command line: run cd ./docs/documentation to change directory to where the manual pages are stored run mkdocs serve to start the local web server with MkDocs and view the documentation in the web browser","title":"Documentation"},{"location":"guides/submitting-pr/","text":"Submitting a PR \u00b6 We appreciate your initiative and would love to integrate your work with the rest of the project! Here is how you can help us do it as quickly as possible. check, that your feature branch is up-to-date. If it's not, there is a risk of merge conflicts or other issues that will complicate merging your changes into the main repository. Refer to these resources for more information on syncing your repo: GitHub Help: Syncing a Fork AC: Keep Your Forked Git Repo Updated with Changes from the Original Upstream Repo Looking for a quick cheat sheet? Look no further: ```sh assuming you are in the folder of your locally cloned fork.... \u00b6 git checkout dev assuming you have a remote named upstream pointing to the official sp-dev-fx-property-controls repo \u00b6 git fetch upstream update your local dev branch to be a mirror of what's in the main repo \u00b6 git pull --rebase upstream dev switch to your branch where you are working, say \"issue-xyz\" \u00b6 git checkout issue-xyz update your branch to update its fork point to the current tip of dev & put your changes on top of it \u00b6 git rebase dev `` - submit PR to the **dev** branch of the main repo. PRs submitted to other branches will be declined - let us know what's in the PR: is it a new command, bug fix or a minor update in the docs? The clearer the information you provide, the quicker your PR can be verified and merged - ideally 1 PR = 1 commit - this makes it easier to keep the log clear for everyone and track what's changed. If you're new to working with git, we'll squash your commits for you when merging your changes into the main repo - don't worry about changing the version or adding yourself to the list of contributors in package.json`. We'll do that for you when merging your changes.","title":"Submitting a PR"},{"location":"guides/submitting-pr/#submitting-a-pr","text":"We appreciate your initiative and would love to integrate your work with the rest of the project! Here is how you can help us do it as quickly as possible. check, that your feature branch is up-to-date. If it's not, there is a risk of merge conflicts or other issues that will complicate merging your changes into the main repository. Refer to these resources for more information on syncing your repo: GitHub Help: Syncing a Fork AC: Keep Your Forked Git Repo Updated with Changes from the Original Upstream Repo Looking for a quick cheat sheet? Look no further: ```sh","title":"Submitting a PR"},{"location":"guides/submitting-pr/#assuming-you-are-in-the-folder-of-your-locally-cloned-fork","text":"git checkout dev","title":"assuming you are in the folder of your locally cloned fork...."},{"location":"guides/submitting-pr/#assuming-you-have-a-remote-named-upstream-pointing-to-the-official-sp-dev-fx-property-controls-repo","text":"git fetch upstream","title":"assuming you have a remote named upstream pointing to the official sp-dev-fx-property-controls repo"},{"location":"guides/submitting-pr/#update-your-local-dev-branch-to-be-a-mirror-of-whats-in-the-main-repo","text":"git pull --rebase upstream dev","title":"update your local dev branch to be a mirror of what's in the main repo"},{"location":"guides/submitting-pr/#switch-to-your-branch-where-you-are-working-say-issue-xyz","text":"git checkout issue-xyz","title":"switch to your branch where you are working, say \"issue-xyz\""},{"location":"guides/submitting-pr/#update-your-branch-to-update-its-fork-point-to-the-current-tip-of-dev-put-your-changes-on-top-of-it","text":"git rebase dev `` - submit PR to the **dev** branch of the main repo. PRs submitted to other branches will be declined - let us know what's in the PR: is it a new command, bug fix or a minor update in the docs? The clearer the information you provide, the quicker your PR can be verified and merged - ideally 1 PR = 1 commit - this makes it easier to keep the log clear for everyone and track what's changed. If you're new to working with git, we'll squash your commits for you when merging your changes into the main repo - don't worry about changing the version or adding yourself to the list of contributors in package.json`. We'll do that for you when merging your changes.","title":"update your branch to update its fork point to the current tip of dev & put your changes on top of it"},{"location":"helpers/PropertyPaneHelpers/","text":"PropertyPaneHelpers \u00b6 These are helpers to interact with the property pane of the web part. Currently this helper allows you to show a spinner when the property pane is loading resources. This could be loading controls, fetching data, ... Normally you would get a white property pane until all data is loaded. How to use this control in your solutions \u00b6 Check that you installed the @pnp/spfx-property-controls dependency. Check out The getting started page for more information about installing the dependency. Import the following modules to your main web part TypeScript file: import { PropertyPaneHelpers } from '@pnp/spfx-property-controls/lib/helpers' ; You can use the following example to add the spinner to your web part property pane: /** * Load property pane resources */ protected async loadPropertyPaneResources () : Promise < void > { PropertyPaneHelpers . setSpinner ({ bgColor : \"white\" , spinnerProps : { styles : () => { return { circle : { height : 80 , width : 80 } }; } } }); // Write here the code you want to add to load your resources PropertyPaneHelpers . clearSpinner ( 200 ); } Implementation \u00b6 The setSpinner method allows you to set the following properties: Property Type Required Description bgColor string no Spinner background color className string no Class name to style the spinner yourself. spinnerProps ISpinnerProps no Spinner properties from Office UI Fabric.","title":"PropertyPaneHelpers"},{"location":"helpers/PropertyPaneHelpers/#propertypanehelpers","text":"These are helpers to interact with the property pane of the web part. Currently this helper allows you to show a spinner when the property pane is loading resources. This could be loading controls, fetching data, ... Normally you would get a white property pane until all data is loaded.","title":"PropertyPaneHelpers"},{"location":"helpers/PropertyPaneHelpers/#how-to-use-this-control-in-your-solutions","text":"Check that you installed the @pnp/spfx-property-controls dependency. Check out The getting started page for more information about installing the dependency. Import the following modules to your main web part TypeScript file: import { PropertyPaneHelpers } from '@pnp/spfx-property-controls/lib/helpers' ; You can use the following example to add the spinner to your web part property pane: /** * Load property pane resources */ protected async loadPropertyPaneResources () : Promise < void > { PropertyPaneHelpers . setSpinner ({ bgColor : \"white\" , spinnerProps : { styles : () => { return { circle : { height : 80 , width : 80 } }; } } }); // Write here the code you want to add to load your resources PropertyPaneHelpers . clearSpinner ( 200 ); }","title":"How to use this control in your solutions"},{"location":"helpers/PropertyPaneHelpers/#implementation","text":"The setSpinner method allows you to set the following properties: Property Type Required Description bgColor string no Spinner background color className string no Class name to style the spinner yourself. spinnerProps ISpinnerProps no Spinner properties from Office UI Fabric.","title":"Implementation"}]}
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
new file mode 100644
index 00000000..0f8724ef
--- /dev/null
+++ b/sitemap.xml
@@ -0,0 +1,3 @@
+
+