-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
13,276 additions
and
11,885 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.22.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"@microsoft/generator-sharepoint": { | ||
"version": "1.2.0", | ||
"version": "1.11.0", | ||
"libraryName": "sp-dev-fx-controls-react", | ||
"libraryId": "92b1e52c-a5fa-490a-bcf4-76080f39442c", | ||
"environment": "spo" | ||
"environment": "spo", | ||
"isDomainIsolated": false, | ||
"isCreatingSolution": true, | ||
"packageManager": "npm", | ||
"componentType": "webpart" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "https://dev.office.com/json-schemas/spfx-build/copy-assets.schema.json", | ||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json", | ||
"deployCdnPath": "temp/deploy" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"$schema": "https://dev.office.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", | ||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", | ||
"workingDir": "./temp/deploy/", | ||
"account": "<!-- STORAGE ACCOUNT NAME -->", | ||
"container": "sp-dev-fx-controls-react", | ||
"accessKey": "<!-- ACCESS KEY -->" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "https://dev.office.com/json-schemas/spfx-build/write-manifests.schema.json", | ||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", | ||
"cdnBasePath": "<!-- PATH TO CDN -->" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Migrating from v1 to v2 | ||
|
||
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 the `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 on the issues list so we can update the guide. Thanks! | ||
|
||
## v2 Supports SharePoint Online **only** | ||
|
||
V2 of Reusable Controls is based on SharePoint Framework 1.11. Due to this change, it does not support SharePoint on-premises. **Please, use v1 if you plan to deploy your solution on-premises.** | ||
|
||
## React and Fluent UI versions | ||
|
||
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: | ||
|
||
```json | ||
"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 the SharePoint Framework solution is to use [Office365 CLI](https://pnp.github.io/office365-cli/cmd/spfx/project/project-upgrade/#spfx-project-upgrade) `spfx project upgrade` command. | ||
|
||
## APIs Changes | ||
|
||
### PeoplePicker | ||
|
||
- `isRequired` is renamed to `required` | ||
- The property has been renamed to use the common approach for mandatory field naming. | ||
- `errorMessage` represents a static error message to be displayed in the control. | ||
- In v1 `errorMessage` is used to provide the text that will be displayed if the field is set as `required` and no value is selected. | ||
- In v2 you can use this property to display an error message for whatever reason statically. | ||
|
||
```typescript | ||
/** | ||
* Static error message displayed below the text field. Use onGetErrorMessage to dynamically change the error message displayed (if any) based on the current value. errorMessage and onGetErrorMessage are mutually exclusive (errorMessage takes precedence). | ||
*/ | ||
errorMessage?: string; | ||
``` | ||
|
||
- `onGetErrorMessage` to get error messages dynamically. | ||
- The method is used to get the validation error message and determine whether the input value is valid. Mutually exclusive with the static string errorMessage (it will take precedence over this). | ||
|
||
```typescript | ||
/** | ||
* The method is used to get the validation error message and determine whether the picker value is valid. | ||
* Mutually exclusive with the static string errorMessage (it will take precedence over this). | ||
* | ||
* When it returns string: | ||
* - If valid, it returns empty string. | ||
* - If invalid, it returns the error message string and the picker will | ||
* show an error message below the picker. | ||
* | ||
* When it returns Promise<string>: | ||
* - The resolved value is display as error message. | ||
* - The rejected, the value is thrown away. | ||
* | ||
*/ | ||
onGetErrorMessage?: (items: IPersonaProps[]) => string | Promise<string>; | ||
``` | ||
|
||
- `showRequiredError` has been deleted. | ||
- Use `errorMessage` or `onGetErrorMessage` to provide the error message. | ||
- `selectedItems` is renamed to `onChange` | ||
- `onChange` better describes the purpose of the property. | ||
|
||
### FolderPicker | ||
`FolderPicker` default picker has been removed. | ||
If you used `FolderPicker` as: | ||
```typescript | ||
import FolderPicker from '@pnp/spfx-controls-react/lib/controls/folderPicker/FolderPicker'; | ||
``` | ||
You should update to | ||
```typescript | ||
import { FolderPicker } from '@pnp/spfx-controls-react/lib/FolderPicker'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.