Skip to content
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 @@ -6312,7 +6312,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentNavGroup.Gap">
<summary>
Defines the vertical spacing between the NavGroup and adjecent items.
Defines the vertical spacing between the NavGroup and adjacent items.
Needs to be a valid CSS value.
</summary>
</member>
Expand All @@ -6324,7 +6324,7 @@
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentNavGroup.TitleTemplate">
<summary>
Allows for specific markup and styling to be applied for the group title
When using this, the containded <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentNavLink"/>s and <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentNavGroup"/>s need to be placed in a ChildContent tag.
When using this, the contained <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentNavLink"/>s and <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentNavGroup"/>s need to be placed in a ChildContent tag.
When specifying both Title and TitleTemplate, both will be rendered.
</summary>
</member>
Expand Down Expand Up @@ -9277,7 +9277,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.DesignTokens.DesignToken`1.Name">
<summary>
Gets the name of this design token
Gets the name of this design token
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.DesignTokens.DesignToken`1.Value">
Expand All @@ -9303,9 +9303,16 @@
<member name="M:Microsoft.FluentUI.AspNetCore.Components.DesignTokens.DesignToken`1.OnAfterRenderAsync(System.Boolean)">
<inheritdoc/>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.DesignTokens.DesignToken`1.WithDefault(System.String)">
<summary>
Sets the default value of this token
Value is a string
</summary>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.DesignTokens.DesignToken`1.WithDefault(`0)">
<summary>
Sets the default value of this token
Value is a type T
</summary>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.DesignTokens.DesignToken`1.Create(System.String)">
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Components/Base/FluentInputBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected async Task SetCurrentValueAsync(TValue? value)
Value = value;
if (ValueChanged.HasDelegate)
{
// Thread Safety: Force `ValueChanged` to be re-associated with the Dispatcher, prior to invokation.
// Thread Safety: Force `ValueChanged` to be re-associated with the Dispatcher, prior to invocation.
await InvokeAsync(async () => await ValueChanged.InvokeAsync(value));
}
if (FieldBound)
Expand Down
16 changes: 15 additions & 1 deletion src/Core/DesignTokens/DesignToken.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class DesignToken<T> : ComponentBase, IDesignToken<T>, IAsyncDisp
//private T? _defaultValue;

/// <summary>
/// Gets the name of this design token
/// Gets the name of this design token
/// </summary>
public string? Name { get; init; }

Expand Down Expand Up @@ -70,8 +70,21 @@ private async Task InitJSReferenceAsync()
_jsModule ??= await JSRuntime.InvokeAsync<IJSObjectReference>("import", "./_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js");
}

#pragma warning disable VSTHRD200 // Use "Async" suffix for async methods
/// <summary>
/// Sets the default value of this token
/// Value is a string
/// </summary>
public async ValueTask<DesignToken<T>> WithDefault(string value)
{
await InitJSReferenceAsync();
await _jsModule.InvokeVoidAsync(Name + ".withDefault", value);
return this;
}

/// <summary>
/// Sets the default value of this token
/// Value is a type T
/// </summary>
public async ValueTask<DesignToken<T>> WithDefault(T value)
{
Expand Down Expand Up @@ -134,6 +147,7 @@ public async ValueTask<object> ParseColorHex(string color)
await InitJSReferenceAsync();
return await _jsModule.InvokeAsync<object>("parseColorHexRGB", color);
}
#pragma warning restore VSTHRD200 // Use "Async" suffix for async methods

public async ValueTask DisposeAsync()
{
Expand Down