-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Control PropertyFieldButton (#613)
* commit changes new control PropertyFieldButton * new Control Button * commit changes new control PropertyFieldButton
- Loading branch information
1 parent
95b2f16
commit 8899932
Showing
11 changed files
with
1,748 additions
and
1,277 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# PropertyFieldButton control | ||
|
||
This control generates a Button Control . | ||
|
||
**PropertyFieldButton example usage** | ||
|
||
![PropertyFieldButton example](../assets/propertyFieldButton.gif) | ||
|
||
## How to use this control in your solutions | ||
|
||
- Check that you installed the `@pnp/spfx-property-controls` dependency. Check out The [getting started](../../#getting-started) page for more information about installing the dependency. | ||
- Import the following modules to your component: | ||
|
||
```TypeScript | ||
import { PropertyFieldButton} from '@pnp/spfx-property-controls/lib/PropertyFieldButton'; | ||
``` | ||
|
||
- Add the custom property control to the `groupFields` of the web part property pane configuration: | ||
|
||
```TypeScript | ||
PropertyFieldButton("", { | ||
text={"Button"} | ||
key={"buttonID"} | ||
disabled={false} | ||
className={className} | ||
styles={styles} | ||
onClick={()=>{alert("Button Clicked")}} | ||
iconProps={iconProps} | ||
isPrimary={true} | ||
isVIsible={true} | ||
|
||
}) | ||
``` | ||
|
||
## Implementation | ||
|
||
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 | | ||
|
||
![](https://telemetry.sharepointpnp.com/sp-dev-fx-property-controls/wiki/PropertyFieldButton) |
Oops, something went wrong.