-
Notifications
You must be signed in to change notification settings - Fork 2
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
105 changed files
with
542 additions
and
300 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
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
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,88 +1,93 @@ | ||
<# | ||
.SYNOPSIS | ||
Sample control for UniversalDashboard. | ||
Short description | ||
.DESCRIPTION | ||
Sample control function for UniversalDashboard. This function must have an ID and return a hash table. | ||
Long description | ||
.PARAMETER Id | ||
An id for the component default value will be generated by new-guid. | ||
Parameter description | ||
.PARAMETER ClassName | ||
Parameter description | ||
.PARAMETER AutoFocus | ||
Parameter description | ||
.PARAMETER Checked | ||
Parameter description | ||
.PARAMETER DefaultChecked | ||
Parameter description | ||
.PARAMETER Disabled | ||
Parameter description | ||
.PARAMETER Loading | ||
Parameter description | ||
.PARAMETER Size | ||
Parameter description | ||
.PARAMETER OnChange | ||
Parameter description | ||
.PARAMETER Style | ||
Parameter description | ||
.EXAMPLE | ||
PS C:\> <example usage> | ||
Explanation of what the example does | ||
.INPUTS | ||
Inputs (if any) | ||
.OUTPUTS | ||
Output (if any) | ||
An example | ||
.NOTES | ||
General notes | ||
General notes | ||
#> | ||
function New-UDAntdSwitch { | ||
[CmdletBinding()] | ||
[OutputType('Ant.Design.Switch')] | ||
param( | ||
[Parameter()] | ||
[string]$Id = (New-Guid).ToString(), | ||
[Parameter()] | ||
[string]$ClassName, | ||
[Parameter()] | ||
[switch]$autoFocus, | ||
[Parameter()] | ||
[switch]$checked, | ||
[Parameter()] | ||
[object]$checkedChildren, | ||
[switch]$AutoFocus, | ||
[Parameter()] | ||
[switch]$defaultChecked, | ||
[switch]$Checked, | ||
[Parameter()] | ||
[switch]$disabled, | ||
[switch]$DefaultChecked, | ||
[Parameter()] | ||
[switch]$loading, | ||
[switch]$Disabled, | ||
[Parameter()] | ||
[ValidateSet("default","small","large")] | ||
[string]$size, | ||
[switch]$Loading, | ||
[Parameter()] | ||
[object]$unCheckedChildren, | ||
[ValidateSet("default", "small", "large")] | ||
[string]$Size, | ||
[Parameter()] | ||
[object]$onChange, | ||
[scriptblock]$OnChange, | ||
[Parameter()] | ||
[hashtable]$Style | ||
|
||
) | ||
|
||
End { | ||
|
||
if ($null -ne $OnClick) { | ||
if ($OnClick -is [scriptblock]) { | ||
$OnClick = New-UDEndpoint -Endpoint $OnClick -Id ($Id + "onClick") | ||
} | ||
elseif ($OnClick -isnot [UniversalDashboard.Models.Endpoint]) { | ||
throw "OnClick must be a script block or UDEndpoint" | ||
} | ||
|
||
if ( $Null -ne $onChange ) { | ||
New-UDEndpoint -Endpoint $onChange -Id ($Id + "onChange") | Out-Null | ||
} | ||
|
||
if ($null -ne $onChange) { | ||
if ($onChange -is [scriptblock]) { | ||
$onChange = New-UDEndpoint -Endpoint $onChange -Id ($Id + "onChange") | ||
} | ||
elseif ($onChange -isnot [UniversalDashboard.Models.Endpoint]) { | ||
throw "OnClick must be a script block or UDEndpoint" | ||
} | ||
} | ||
|
||
@{ | ||
assetId = $AssetId | ||
isPlugin = $true | ||
type = "ud-antd-switch" | ||
id = $Id | ||
className = $ClassName | ||
autoFocus = $AutoFocus.IsPresent | ||
checked = $Checked.IsPresent | ||
checkedChildren = $CheckedChildren | ||
$AntdSwitch = @{ | ||
assetId = $AssetId | ||
isPlugin = $true | ||
type = "ud-antd-switch" | ||
id = $Id | ||
autoFocus = $AutoFocus.IsPresent | ||
checked = $Checked.IsPresent | ||
defaultChecked = $DefaultChecked.IsPresent | ||
disabled = $Disabled.IsPresent | ||
loading = $Loading.IsPresent | ||
size = $Size | ||
unCheckedChildren = $UnCheckedChildren | ||
# onChange = $OnChange | ||
# onClick = $OnClick | ||
style = $Style | ||
disabled = $Disabled.IsPresent | ||
loading = $Loading.IsPresent | ||
size = $Size | ||
style = $Style | ||
} | ||
|
||
$AntdSwitch.PSTypeNames.Insert(0, 'Ant.Design.Switch') | ||
$AntdSwitch | ||
} | ||
} |
Oops, something went wrong.