Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij committed Nov 28, 2023
2 parents d729644 + 6d426e9 commit 26b50a6
Show file tree
Hide file tree
Showing 215 changed files with 3,894 additions and 1,550 deletions.
6 changes: 4 additions & 2 deletions .azure-devops/common/template-to-build-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ steps:
version: 8.0.x
includePreviewVersions: true

# Set version number
# Set version number (exclude Templates/content)
- task: Assembly-Info-NetCore@3
displayName: 'Versioning $(Build.BuildNumber)'
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: '**/*.csproj'
FileNames: |
**/*.csproj
!**/src/Templates/content/**/*.csproj
InsertAttributes: true
FileEncoding: 'auto'
WriteBOM: false
Expand Down
2 changes: 1 addition & 1 deletion .azure-devops/common/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ variables:
# File and Package version
# dev branch: 1.2.4-Preview-23282-1' (PackageSuffix is always ignored in Dev branch)
# main branch: 1.2.4-RC.1' (PackageSuffix is ignored, if empty, in Main branch)
FileVersion: '4.0.0'
FileVersion: '4.1.0' # Set the next final version here.
PackageSuffix: ''
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(AspNetCoreVersion)" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23472.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="$(EfCoreVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.CommandLine" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
Expand All @@ -22,15 +22,15 @@
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.0.0" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.0.0" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" version="4.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="System.Text.Encodings.Web" Version="8.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.0" />
<!-- test dependencies -->
<PackageVersion Include="bunit" Version="1.25.1-preview" />
<PackageVersion Include="bunit" Version="1.25.3" />
<PackageVersion Include="FluentAssertions" Version="7.0.0-alpha.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0-preview-23503-02" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="xunit" Version="2.6.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>
Expand Down
18 changes: 16 additions & 2 deletions WHATSNEW.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
## V4.0.0
## V4.1.0
- FluentCalendar: Add new views to select month/year
- FluentCheckbox: Add tri-state support
- FluentAccordionItem: Add HeaderTemplate parameter
- FluentSplitter: Add Panel1MinSize, Panel2MinSize and BarSize parameter
- FluentSplitter: Make resizing always use proportional values
- FluentSplitter: Add support for collapsing panel 2 (right/bottom), add `OnCollapsed`, `OnExpanded` and `OnResized` event callbacks
- Fix using checkbox, switch, slider being used in `EditForm` not getting set on first few clicks
- Fix Web App template to correctly handle NavMenu based on rendermode and interactivity choices
- Move CacheStorageAccessor and StaticAssetService to Demo.Shared project as these are specific to the demo site and not the library
- Update Fluent UI System Icons to 1.1.223 (no overview of what's new/changed this time)
- Demo: Move ErrorBoundry into DemoSection component so pagge keeps working when only one section fails
- Fix miscellaneous demo errors caused by trimming

## V4.0.0
- FluentAccordionItem: Add `HeaderTemplate` parameter

- ## V4.0.0-rc.3
## V4.0.0-rc.3
- Undo change template interactivity default to None. Default is now Server (same as regular Blazor template)
- FluentSplitter: Add support for collapsing panel 2 (right/bottom), add `OnCollapsed`, `OnExpanded` and `OnResized` event callbacks
- `variables.css` is imported in the automatically loaded library's css now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class EmojiExplorer

private readonly EmojiSearchCriteria Criteria = new();
private EmojiInfo[] EmojisFound = Array.Empty<EmojiInfo>();
private PaginationState PaginationState = new PaginationState { ItemsPerPage = 4 * 12 };
private PaginationState PaginationState = new() { ItemsPerPage = 4 * 12 };

[Parameter]
public string Title { get; set; } = "FluentUI Blazor - Emoji Explorers";
Expand Down Expand Up @@ -46,11 +46,14 @@ private async Task StartNewSearchAsync()
SearchInProgress = true;
await Task.Delay(1); // Display spinner

EmojisFound = Emojis.AllEmojis
.Where(i => i.Style == Criteria.Style
&& (string.IsNullOrWhiteSpace(Criteria.SearchTerm) ? true : i.Name.Contains(Criteria.SearchTerm, StringComparison.InvariantCultureIgnoreCase)))
.OrderBy(i => i.Name)
.ToArray();
EmojisFound =
[
.. Emojis.AllEmojis
.Where(i => i.Style == Criteria.Style
&& (string.IsNullOrWhiteSpace(Criteria.SearchTerm) ? true : i.Name.Contains(Criteria.SearchTerm, StringComparison.InvariantCultureIgnoreCase)))
.OrderBy(i => i.Name)
,
];

await PaginationState.SetTotalItemCountAsync(EmojisFound.Length);

Expand Down
17 changes: 10 additions & 7 deletions examples/Demo/AssetExplorer/Components/Pages/IconExplorer.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class IconExplorer

private readonly IconSearchCriteria Criteria = new();
private IconInfo[] IconsFound = Array.Empty<IconInfo>();
private PaginationState PaginationState = new PaginationState { ItemsPerPage = 4 * 12 };
private PaginationState PaginationState = new() { ItemsPerPage = 4 * 12 };

[Parameter]
public string Title { get; set; } = "FluentUI Blazor - Icon Explorers";
Expand Down Expand Up @@ -47,12 +47,15 @@ private async Task StartNewSearchAsync()
SearchInProgress = true;
await Task.Delay(1); // Display spinner

IconsFound = Icons.AllIcons
.Where(i => i.Variant == Criteria.Variant
&& i.Size == Criteria.Size
&& (string.IsNullOrWhiteSpace(Criteria.SearchTerm) ? true : i.Name.Contains(Criteria.SearchTerm, StringComparison.InvariantCultureIgnoreCase)))
.OrderBy(i => i.Name)
.ToArray();
IconsFound =
[
.. Icons.AllIcons
.Where(i => i.Variant == Criteria.Variant
&& i.Size == Criteria.Size
&& (string.IsNullOrWhiteSpace(Criteria.SearchTerm) ? true : i.Name.Contains(Criteria.SearchTerm, StringComparison.InvariantCultureIgnoreCase)))
.OrderBy(i => i.Name)
,
];

await PaginationState.SetTotalItemCountAsync(IconsFound.Length);

Expand Down
2 changes: 1 addition & 1 deletion examples/Demo/DocGenerator/CodeCommentsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)

public void GenerateSource(SourceProductionContext context, ImmutableArray<AdditionalText> files)
{
List<XElement> members = new();
List<XElement> members = [];


foreach (AdditionalText file in files)
Expand Down
6 changes: 3 additions & 3 deletions examples/Demo/Shared/Components/ApiDocumentation.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private class MemberDescription
private string? _displayName, _id;

/// <summary>
/// The Component for which the Parameters, Methods and Events should be displayed
/// Gets or sets the Component for which the Parameters, Methods and Events should be displayed.
/// </summary>

[Parameter, EditorRequired]
Expand All @@ -40,7 +40,7 @@ private class MemberDescription
public Type[] InstanceTypes { get; set; } = new[] { typeof(string) };

/// <summary>
/// The label used for displaying the type parameter
/// Gets or sets the label used for displaying the type parameter.
/// </summary>
[Parameter]
public string? GenericLabel { get; set; } = null;
Expand All @@ -66,7 +66,7 @@ private IEnumerable<MemberDescription> GetMembers(MemberTypes type)

if (_allMembers == null)
{
List<MemberDescription>? members = new();
List<MemberDescription>? members = [];

object? obj;
if (Component.IsGenericType)
Expand Down
9 changes: 8 additions & 1 deletion examples/Demo/Shared/Components/DemoSection.razor
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
@ChildContent
@if (Component is not null)
{
<DynamicComponent Type="Component" Parameters="ComponentParameters" />
<ErrorBoundary @ref="errorBoundary">
<ChildContent>
<DynamicComponent Type="Component" Parameters="ComponentParameters" />
</ChildContent>
<ErrorContent Context="ex">
<div class="blazor-error-boundary">@ex.Message</div>
</ErrorContent>
</ErrorBoundary>
}
</div>
</Content>
Expand Down
18 changes: 14 additions & 4 deletions examples/Demo/Shared/Components/DemoSection.razor.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
using System.Reflection.Metadata;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.FluentUI.AspNetCore.Components.Infrastructure;

namespace FluentUI.Demo.Shared.Components;
public partial class DemoSection : ComponentBase
{
private bool _hasCode = false;
private readonly Dictionary<string, string> _tabPanelsContent = new();
private readonly List<string> _allFiles = new();
private readonly Dictionary<string, string> _tabPanelsContent = [];
private readonly List<string> _allFiles = [];
private string? _ariaId;

private readonly Regex _pattern = new(@"[;,<>&(){}!$^#@=/\ ]");
private readonly Regex _pattern = Pattern();
private ErrorBoundary? errorBoundary;

[Inject]
private HttpClient HttpClient { get; set; } = default!;
Expand All @@ -30,7 +32,7 @@ public partial class DemoSection : ComponentBase
public RenderFragment? Description { get; set; }

/// <summary>
/// The component for which the example will be shown. Enter the type (typeof(...)) _name
/// Gets or sets the component for which the example will be shown. Enter the type (typeof(...)) _name
/// </summary>
[Parameter, EditorRequired]
public Type Component { get; set; } = default!;
Expand Down Expand Up @@ -105,6 +107,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
}
}

protected override void OnParametersSet()
{
errorBoundary?.Recover();
}

protected async Task SetCodeContentsAsync()
{
HttpClient.BaseAddress ??= new Uri(NavigationManager.BaseUri);
Expand Down Expand Up @@ -173,4 +180,7 @@ static string GetDisplayName(string name)

return null;
}

[GeneratedRegex(@"[;,<>&(){}!$^#@=/\ ]")]
private static partial Regex Pattern();
}
16 changes: 11 additions & 5 deletions examples/Demo/Shared/Components/TableOfContents.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public override int GetHashCode()
public string Heading { get; set; } = "In this article";

/// <summary>
/// Gets or sets if a 'Back to top' button should be rendered.
/// Gets or sets a value indicating whether a 'Back to top' button should be rendered.
/// Defaults to true
/// </summary>
[Parameter]
Expand All @@ -85,12 +85,19 @@ protected override async Task OnAfterRenderAsync(bool firstRender)

if (mobile)
_expanded = false;

await BackToTop();
await QueryDom();

}
}

private async Task BackToTop()
{
if (_jsModule is null)
{
return;
}
await _jsModule.InvokeAsync<Anchor[]?>("backToTop");
}

Expand All @@ -114,8 +121,8 @@ private async Task QueryDom()

private bool AnchorsEqual(Anchor[]? firstSet, Anchor[]? secondSet)
{
return (firstSet ?? Array.Empty<Anchor>())
.SequenceEqual(secondSet ?? Array.Empty<Anchor>());
return (firstSet ?? [])
.SequenceEqual(secondSet ?? []);
}

protected override void OnInitialized()
Expand All @@ -128,6 +135,7 @@ private async void LocationChanged(object? sender, LocationChangedEventArgs e)
{
try
{
await BackToTop();
await QueryDom();
}
catch (Exception)
Expand Down Expand Up @@ -180,8 +188,6 @@ public async Task Refresh()

}



async ValueTask IAsyncDisposable.DisposeAsync()
{
try
Expand Down
Loading

0 comments on commit 26b50a6

Please sign in to comment.