Badgerati / Pode.Web

Web template framework for use with the Pode PowerShell web server
MIT License
189 stars 24 forks source link

Adds support for customising which buttons are visible on Forms and Modals #591

Closed Badgerati closed 3 months ago

Badgerati commented 3 months ago

Description of the Change

Examples

if you want a Form with a Submit and Reset button:

New-PodeWebForm -Name 'Example' -ButtonType Submit, Reset -Content @() -ScriptBlock {}

if you want a Form with just a Reset button:

New-PodeWebForm -Name 'Example' -ButtonType Submit, Reset -Content @() -ScriptBlock {}

if you want a Form with no buttons:

New-PodeWebForm -Name 'Example' -ButtonType None -Content @() -ScriptBlock {}


* Modal
```powershell
# default close and no scriptblock
New-PodeWebModal -Name 'Example' -Content @()

# default close/submit and scriptblock
New-PodeWebModal -Name 'Example' -AsForm -Content @() -ScriptBlock {}

# scriptblock with only submit and reset
New-PodeWebModal -Name 'Example' -ButtonType Submit, Reset -AsForm -Content @() -ScriptBlock {}

# scriptblock with no buttons
New-PodeWebModal -Name 'Example' -ButtonType None -AsForm -Content @() -ScriptBlock {}