Skip to content

Remove validator APIs that are not supported #5692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,6 @@
<DocsMethodsItem Name="IsFileSelected">
Checks if the file is selected.
</DocsMethodsItem>
<DocsMethodsItem Name="IsDateSelected<TValue>">
Checks if the date is selected.
</DocsMethodsItem>
<DocsMethodsItem Name="AreDatesSelected<TValue>">
Checks if more than one date is selected.
</DocsMethodsItem>
</DocsMethods>

<DocsPageSubtitle>
Expand Down
28 changes: 0 additions & 28 deletions Source/Blazorise/Components/Validation/ValidationRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,33 +184,5 @@ public static void IsFileSelected( ValidatorEventArgs e )
}
}

/// <summary>
/// Checks if the date is selected.
/// </summary>
/// <typeparam name="TValue">Data-type used be binded by the Date property.</typeparam>
/// <param name="e"></param>
public static void IsDateSelected<TValue>( ValidatorEventArgs e )
{
var dates = e.Value as IEnumerable<TValue>;

e.Status = dates.Count( x => !x.IsEqual( default ) ) >= 1
? ValidationStatus.Success
: ValidationStatus.Error;
}

/// <summary>
/// Checks if the date range is selected.
/// </summary>
/// <typeparam name="TValue">Data-type used be binded by the Dates property.</typeparam>
/// <param name="e"></param>
public static void AreDatesSelected<TValue>( ValidatorEventArgs e )
{
var dates = e.Value as IEnumerable<TValue>;

e.Status = dates?.Count( x => !x.IsEqual( default ) ) >= 2
? ValidationStatus.Success
: ValidationStatus.Error;
}

#endregion
}
Loading