Closed danielchalmers closed 2 weeks ago
Attention: Patch coverage is 73.33333%
with 4 lines
in your changes are missing coverage. Please review.
Project coverage is 90.04%. Comparing base (
28bc599
) to head (b205a85
). Report is 127 commits behind head on dev.
Files | Patch % | Lines |
---|---|---|
src/MudBlazor/Services/MudGlobal.cs | 55.55% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
In principle yes, it makes sense to have global defaults for every parameter, even those of MudDialog
. I first thought, this would be better suited for DialogOptions
but then, it is a parameter of a component and thus the default value would be expected to be customizable like all the other component parameters.
When we add defaults for all components, there will be hundreds of definitions in MudGlobal
. It might become quite unmanageable. You sure we shouldn't make static subclasses of MudGlobal for every component?
i.e.
MudGlobal.DialogDefaults.DefaultFocus = ...
MudGlobal.ButtonDefaults.Variant = ...
@henon Do you want to implement your vision for that API separately and I rebase? Or tell me what the classes would look like and I can do it in this PR?
public static class MudGlobal {
public static class DialogDefaults {
public DefaultFocus DefaultFocus = DefaultFocus.Element;
}
public static class ButtonDefaults {
public static Variant Variant = Variant.Text;
}
}
@henon Done. Take a look now.
Here is another idea, add these on top of what you already have:
public static class OverlayDefaults
{
/// <summary>
/// The default transition delay for <see cref="MudOverlay"/> and <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Delay { get; set; } = TransitionDefaults.Delay;
/// <summary>
/// The default transition time for components like <see cref="MudTooltip"/>, <see cref="MudOverlay"/>, <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Duration { get; set; } = TransitionDefaults.Duration;
}
public static class PickerDefaults
{
/// <summary>
/// The default transition delay for <see cref="MudOverlay"/> and <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Delay { get; set; } = TransitionDefaults.Delay;
/// <summary>
/// The default transition time for components like <see cref="MudTooltip"/>, <see cref="MudOverlay"/>, <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Duration { get; set; } = TransitionDefaults.Duration;
}
public static class TooltipDefaults
{
/// <summary>
/// The default transition delay for <see cref="MudOverlay"/> and <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Delay { get; set; } = TransitionDefaults.Delay;
/// <summary>
/// The default transition time for components like <see cref="MudTooltip"/>, <see cref="MudOverlay"/>, <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Duration { get; set; } = TransitionDefaults.Duration;
}
That way, on top of changing the delay and transition duration for all via TransitionDefaults we can also set them differently for overlay, picker and tooltip.
@henon Good idea. Added.
Description
How Has This Been Tested?
Type of Changes
Checklist
dev
).