-
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.
Merge pull request #941 from pnp/dev
Merge for 3.2.0
- Loading branch information
Showing
96 changed files
with
5,213 additions
and
31,121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,4 @@ docs/documentation/site | |
|
||
# release | ||
release | ||
*.scss.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Dynamic Form | ||
|
||
This control can dynamically generate SharePoint list or SharePoint document library form and everything controlled through list setting. | ||
|
||
## How to use this control in your solutions | ||
|
||
- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency. | ||
- Import the following modules to your component: | ||
|
||
```TypeScript | ||
import { DynamicForm } from "fx-controls-react/lib/DynamicForm"; | ||
``` | ||
|
||
- Use the DynamicForm control in your code as follows: | ||
|
||
```jsx | ||
<DynamicForm | ||
context={this.props.context} | ||
listId={"3071c058-549f-461d-9d73-8b9a52049a80"} | ||
listItemId={1}> | ||
onCancelled={() => { console.log('Cancelled') }} | ||
onBeforeSubmit={(async listItem) => { return true; }} | ||
onSubmitError={(listItem, error) => { alert(error.message); }} | ||
onSubmitted={async (listItemData) => { console.log(listItemData); }}> | ||
</DynamicForm> | ||
``` | ||
![DynamicForm](../assets/DynamicForm.png) | ||
|
||
## Implementation | ||
|
||
The `DynamicForm` can be configured with the following properties: | ||
|
||
| Property | Type | Required | Description | | ||
| ---- | ---- | ---- | ---- | | ||
| context | BaseComponentContext | yes | The context object of the SPFx loaded webpart or customizer. | | ||
| listId | string | yes | Guid of the list.| | ||
| listItemId | number | no | list item ID. | | ||
| contentTypeId | string | no | content type ID | | ||
| disabled | boolean | no | Option allow to be enable or disable. Default value is `false`| | ||
| onBeforeSubmit | (listItemData: any) => Promise<boolean> | no | Before submit handler. Allows to modify the object to be submitted or cancel the submission. | | ||
| onSubmitted | (listItem: any) => void | no | Method that returns listItem data JSON object. | | ||
| onSubmitError | (listItemData: any, error: Error) => void | no | Handler of submission error. | | ||
| onCancelled | () => void | no | Handler when form has been cancelled. | |
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
Oops, something went wrong.