< Summary

Information
Class: Syki.Front.Components.Passwords.PasswordTextField
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Components/Passwords/PasswordTextField.razor
Tag: 22_11348620282
Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 53
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Required()100%210%
get_Value()100%210%
get_Class()100%210%
get_ValueChanged()100%210%
.ctor()100%210%
PasswordIconClick()0%620%

File(s)

/home/runner/work/syki/syki/Front/Components/Passwords/PasswordTextField.razor

#LineLine coverage
 1@namespace Syki.Front.Components.Passwords
 2
 3<MudTextField
 4    Margin="Margin.Dense"
 5    Adornment="Adornment.End"
 6    AdornmentIcon="@_passwordIcon"
 7    OnAdornmentClick="@PasswordIconClick"
 8    InputType="@_passwordInputType"
 9    Label="Senha"
 10    Class="@Class"
 11    Immediate="true"
 12    OnlyValidateIfDirty="true"
 13    Value="@Value"
 14    ValueChanged="@ValueChanged"
 15    Variant="Variant.Outlined"
 16    Required="@Required"
 17    RequiredError="Informe!"
 18/>
 19
 20@code
 21{
 22    [Parameter]
 023    public bool Required { get; set; }
 24
 25    [Parameter]
 026    public string Value { get; set; }
 27
 28    [Parameter]
 029    public string Class { get; set; }
 30
 31    [Parameter]
 032    public EventCallback<string> ValueChanged { get; set; }
 33
 34    private bool _showPassword;
 035    private InputType _passwordInputType = InputType.Password;
 036    private string _passwordIcon = Icons.Material.Filled.VisibilityOff;
 37
 38    private void PasswordIconClick()
 39    {
 040        @if (_showPassword)
 41        {
 042            _showPassword = false;
 043            _passwordIcon = Icons.Material.Filled.VisibilityOff;
 044            _passwordInputType = InputType.Password;
 45        }
 46        else
 47        {
 048            _showPassword = true;
 049            _passwordIcon = Icons.Material.Filled.Visibility;
 050            _passwordInputType = InputType.Text;
 51        }
 052    }
 53}