-
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.
working on fixing the switch component in forms
- Loading branch information
Showing
101 changed files
with
231 additions
and
356 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,118 @@ | ||
New-UDPage -Title 'Forms' -Name 'Form' -Content { | ||
New-UDAntdNotification -Id "info2" -Title "Universal Dashboard" -Description "Notification Description Content" -Preset "success" -Duration 8 | ||
$ReposNames = (Get-Content -Path "$Root\data\data.json" -Raw | ConvertFrom-Json).Name | ||
|
||
$WrapperCol = @{ span = 20; pull = 2; push = 2 } | ||
$InitialValues = @{ | ||
username = "AlonGvili" | ||
password = "Aa123456" | ||
email = "[email protected]" | ||
textbox = "GviliAlon" | ||
input_username = "AlonGvili" | ||
input_password = "Aa123456" | ||
input_email = "[email protected]" | ||
} | ||
$Submit = New-UDAntdButton -Label Demo -HtmlType submit -ButtonType primary | ||
|
||
$Props = @{ | ||
Variant = "small" | ||
Id = "demoForm" | ||
Layout = "vertical" | ||
WrapperCol = $WrapperCol | ||
InitialValues = $InitialValues | ||
SubmitButton = $Submit | ||
} | ||
$WrapperCol = @{ span = 20; pull = 2; push = 2 } | ||
|
||
$Repos = Get-Content -Path "$Root\data\data.json" -Raw | ConvertFrom-Json | ||
[System.Collections.ArrayList]$filters = @() | ||
$null = $filters.AddRange($Repos[0].psobject.Properties.name) | ||
$null = $filters.Add('owner.id') | ||
|
||
$v = Get-Content -Path "$Root\data\data.json" -Raw | ConvertFrom-Json | ||
$NamesAsJson = $v.Name | ConvertTo-Json | ||
New-UDAntdForm -Id 'demoForm' -Variant small -WrapperCol $WrapperCol -InitialValues $InitialValues -Content { | ||
New-UDAntdFormItem -Name 'username' -Content ( | ||
New-UDAntdForm @Props -Content { | ||
|
||
New-UDAntdFormItem -Name 'input_username' -Content { | ||
New-UDAntdInput -PlaceHolder 'Enter your user name' -Prefix ( New-UDAntdIcon -Icon UserOutlined ) | ||
) -Rules @(@{ | ||
} -Rules @(@{ | ||
required = $true | ||
message = "you must enter a user name." | ||
}) | ||
New-UDAntdFormItem -Name 'password' -Content ( | ||
|
||
New-UDAntdFormItem -Name 'input_password' -Content { | ||
New-UDAntdInputPassword -PlaceHolder 'Enter your user password' -Prefix ( New-UDAntdIcon -Icon KeyOutlined ) | ||
) -Rules @(@{ | ||
} -Rules @(@{ | ||
required = $true | ||
message = "you must enter a valide password." | ||
}) | ||
New-UDAntdFormItem -Name "group" -Content ( | ||
New-UDAntdPopover -Trigger ( | ||
New-UDAntdInput -PlaceHolder 'Enter your group name' -Prefix ( New-UDAntdIcon -Icon TeamOutlined ) | ||
) -Content "valide groups names are: dev, ops, qa" | ||
) | ||
New-UDAntdFormItem -Name 'email' -Content ( | ||
|
||
New-UDAntdFormItem -Name "input_group_name" -Content { | ||
New-UDAntdInput -PlaceHolder 'Enter your group name' -Prefix ( New-UDAntdIcon -Icon TeamOutlined ) | ||
} | ||
|
||
New-UDAntdFormItem -Name 'input_email' -Content { | ||
New-UDAntdInput -PlaceHolder 'Enter your email address' -Prefix ( New-UDAntdIcon -Icon MailOutlined ) | ||
) -Rules @(@{ | ||
} -Rules @(@{ | ||
required = $true | ||
message = "you must enter a email address." | ||
type = 'email' | ||
}) | ||
New-UDAntdFormItem -Name 'textbox' -Content ( | ||
New-UDAntdInputTextArea | ||
) | ||
New-UDAntdFormItem -Name 'input_group' -Content ( | ||
|
||
New-UDAntdFormItem -Name @('user', 'text_area_basic') -Content { | ||
New-UDAntdFormItem -NoStyle -Content { | ||
New-UDAntdInputTextArea -Value "alon gvili ud" | ||
} | ||
} | ||
|
||
New-UDAntdFormItem -Name @('user', 'input_group') -Content { | ||
New-UDAntdInputGroup -Content { | ||
New-UDAntdSelect -DataSource { | ||
(Get-Content -Path "$Root\data\data.json" -Raw | ConvertFrom-Json).Foreach( { | ||
New-UDAntdSelectOption -Value $_.Name | ||
}) | ||
} -Bordered -DropdownMatchSelectWidth -Placeholder "Select github repo name." | ||
$ReposNames.Foreach( { New-UDAntdSelectOption -Value $_ }) | ||
} -Bordered -Placeholder "Select github repo name." | ||
New-UDAntdInputNumber | ||
} | ||
) | ||
|
||
New-UDAntdFormItem -Name 'cnum' -Content ( | ||
New-UDAntdInputNumber -DefaultValue 2 | ||
) | ||
New-UDAntdFormItem -HasFeedback -Name "gvili_select" -Content ( | ||
} | ||
} -WrapperCol $WrapperCol | ||
|
||
New-UDAntdFormItem -Name 'input_number' -Content { | ||
New-UDAntdInputNumber | ||
} | ||
|
||
New-UDAntdFormItem -HasFeedback -Name "select_single" -Content { | ||
New-UDAntdSelect -DataSource { | ||
(Get-Content -Path "$Root\data\data.json" -Raw | ConvertFrom-Json).Foreach( { | ||
New-UDAntdSelectOption -Value $_.Name | ||
}) | ||
$ReposNames.Foreach( { New-UDAntdSelectOption -Value $_ }) | ||
} -Bordered -DropdownMatchSelectWidth -Placeholder "Select github repo name." | ||
) | ||
New-UDAntdFormItem -Name 'radioGroup' -Content ( | ||
} | ||
|
||
New-UDAntdFormItem -Name 'radio_group' -Content { | ||
New-UDAntdRadioGroup -Content { | ||
New-UDAntdRadio -Value "VScode" -Content { "Visual Studio Code" } | ||
New-UDAntdRadio -Value "VScodeInsider" -Content { "Visual Studio Code Insider" } | ||
New-UDAntdRadio -Value "VS" -Content { "Visual Studio" } | ||
} | ||
) | ||
New-UDAntdFormItem -Name 'buttonGroup' -Content ( | ||
} | ||
|
||
New-UDAntdFormItem -Name 'radio_buttons_group' -Content { | ||
New-UDAntdRadioGroup -Content { | ||
New-UDAntdRadioButton -Value "VScode" -Content { "Visual Studio Code" } | ||
New-UDAntdRadioButton -Value "VScodeInsider" -Content { "Visual Studio Code Insider" } | ||
New-UDAntdRadioButton -Value "VS" -Content { "Visual Studio" } | ||
} | ||
) | ||
New-UDAntdFormItem -Name 'my_rate' -Content ( | ||
} | ||
|
||
New-UDAntdFormItem -Name 'rate_basic' -Content { | ||
New-UDAntdRate | ||
) -Rules @(@{ | ||
required = $true | ||
message = "you must select a rate." | ||
}) | ||
New-UDAntdFormItem -Name 'my_rate_custom' -Content ( | ||
New-UDAntdRate -Character "??" | ||
) | ||
New-UDAntdFormItem -Name 'my_rate_custom_icon' -Content ( | ||
} | ||
|
||
New-UDAntdFormItem -Name 'rate_emojy' -Content { | ||
New-UDAntdRate -Character "🎀" | ||
} | ||
|
||
New-UDAntdFormItem -Name 'rate_icon' -Content { | ||
New-UDAntdRate -Character ( | ||
New-UDAntdIcon -Icon ForkOutlined -Size 2x | ||
) | ||
) | ||
} -Layout vertical -SubmitButton ( | ||
New-UDAntdButton -Label Demo -HtmlType submit -ButtonType primary | ||
) -ResetButton ( | ||
New-UDAntdButton -Label Clear -ButtonType dashed | ||
) -OnSubmit { | ||
} | ||
|
||
New-UDAntdFormItem -Name 'switch_basic' -ValuePropName "checked" -Content { | ||
New-UDAntdSwitch | ||
} | ||
|
||
} -OnSubmit { | ||
Set-UDElement -Id "info2" -Properties @{ | ||
attributes = @{ | ||
description = ConvertFrom-Json $EventData -AsHashtable | ConvertTo-Json | ||
visible = $true | ||
preset = "info" | ||
duration = 4 | ||
duration = 8 | ||
} | ||
} | ||
} | ||
|
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.