diff --git a/apps/server/AliasVault.Client/Auth/Components/PasswordInputField.razor b/apps/server/AliasVault.Client/Auth/Components/PasswordInputField.razor new file mode 100644 index 000000000..8e4aa8763 --- /dev/null +++ b/apps/server/AliasVault.Client/Auth/Components/PasswordInputField.razor @@ -0,0 +1,79 @@ +@using System.Linq.Expressions + +
+ + + +
+ +@code { + private bool _showPassword = false; + + /// + /// Gets or sets the ID of the input field. + /// + [Parameter] + public required string Id { get; set; } + + /// + /// Gets or sets the value of the input field. + /// + [Parameter] + public required string Value { get; set; } + + /// + /// Gets or sets the event callback that is triggered when the value changes. + /// + [Parameter] + public required EventCallback ValueChanged { get; set; } + + /// + /// Gets or sets the expression that identifies the value property. + /// + [Parameter] + public required Expression> ValueExpression { get; set; } + + /// + /// Gets or sets the placeholder text for the input field. + /// + [Parameter] + public required string Placeholder { get; set; } + + /// + /// Gets or sets additional attributes for the input field. + /// + [Parameter(CaptureUnmatchedValues = true)] + public Dictionary? AdditionalAttributes { get; set; } = new(); + + /// + /// Toggles the password visibility. + /// + private void TogglePasswordVisibility() + { + _showPassword = !_showPassword; + } +} diff --git a/apps/server/AliasVault.Client/Auth/Pages/Login.razor b/apps/server/AliasVault.Client/Auth/Pages/Login.razor index 31d17cc0c..52efae0ca 100644 --- a/apps/server/AliasVault.Client/Auth/Pages/Login.razor +++ b/apps/server/AliasVault.Client/Auth/Pages/Login.razor @@ -98,7 +98,7 @@ else
- +
diff --git a/apps/server/AliasVault.Client/Auth/Pages/Unlock.razor b/apps/server/AliasVault.Client/Auth/Pages/Unlock.razor index bd11ba0a7..56d6ea180 100644 --- a/apps/server/AliasVault.Client/Auth/Pages/Unlock.razor +++ b/apps/server/AliasVault.Client/Auth/Pages/Unlock.razor @@ -67,7 +67,7 @@ else
- +