Skip to content
Merged

Net6 #84

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8ed173d
Upgrade projects to .NET 6
vnbaaij Sep 28, 2021
3f5766f
Enable nullable for sample project
vnbaaij Sep 28, 2021
e9c0f74
Enable Nullable for component project (excluded that changes related …
vnbaaij Sep 28, 2021
79cdfb1
Enable Nullable for FluentInputBase derivates
vnbaaij Sep 29, 2021
da49498
Update component project to only optimie on Release build
vnbaaij Sep 29, 2021
0fe610b
Update component project to only optimize on Release build
vnbaaij Sep 29, 2021
598bd46
Merge branch 'net6' of https://github.com/vnbaaij/fast-blazor into net6
vnbaaij Sep 29, 2021
59b7768
Revert SetParametersAsync logic
vnbaaij Sep 29, 2021
7032a8d
Move RTL/Theme switches to webcomponents page
vnbaaij Sep 29, 2021
2f50d53
Enable Hot Reload
vnbaaij Sep 29, 2021
8bd654a
Upgrade projects to .NET 6
vnbaaij Sep 28, 2021
b29ab95
Enable nullable for sample project
vnbaaij Sep 28, 2021
9be1dc4
Enable Nullable for component project (excluded that changes related …
vnbaaij Sep 28, 2021
ed029ba
Enable Nullable for FluentInputBase derivates
vnbaaij Sep 29, 2021
f01b491
Revert SetParametersAsync logic
vnbaaij Sep 29, 2021
212e431
Move RTL/Theme switches to webcomponents page
vnbaaij Sep 29, 2021
fd775b7
Enable Hot Reload
vnbaaij Sep 29, 2021
03c1d15
Merge
vnbaaij Oct 5, 2021
49372e0
Fix compiler warnings/messages
vnbaaij Oct 5, 2021
5b545c0
Change CI validation to use .NET 6 (prerelease)
vnbaaij Oct 6, 2021
2b674d9
Add link to Fluent UI sample site
vnbaaij Oct 6, 2021
f116db4
Update CI Validation workflow to net 6 branch
vnbaaij Oct 6, 2021
0ed4cb0
Nullable work
vnbaaij Oct 6, 2021
02dc918
Nullable work
vnbaaij Oct 6, 2021
cd1acb3
chore: prepare 0.5.0 release
vnbaaij Oct 11, 2021
9ed89e6
Update to rc2
vnbaaij Oct 12, 2021
a471ec7
Merge branch 'main' into net6
EisenbergEffect Oct 20, 2021
a13e67e
Reverted ci-daily back to main branch
vnbaaij Oct 21, 2021
342f090
Merge branch 'net6' of https://github.com/vnbaaij/fast-blazor into net6
vnbaaij Oct 21, 2021
479daa4
Fix DataGridTest
vnbaaij Oct 23, 2021
b8f21f2
Fix FluentNumberField binding
vnbaaij Oct 23, 2021
cd05c7f
Remove commented code
vnbaaij Oct 25, 2021
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
3 changes: 2 additions & 1 deletion .github/workflows/ci-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x
include-prerelease: true
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

The `Microsoft.Fast.Components.FluentUI` package provides a lightweight set of [Blazor](https://blazor.net) component wrappers around Microsoft's official FluentUI Web Components. The FluentUI Web Components are built on [FAST](https://www.fast.design/) and work in every major browser. To get up and running with `Microsoft.Fast.Components.FluentUI` see the Getting Started section below.

The source for `@fluentui/web-components` is hosted in [the Fluent UI monorepo](https://github.com/microsoft/fluentui/tree/master/packages/web-components).
The source for `@fluentui/web-components` is hosted in [the Fluent UI monorepo](https://github.com/microsoft/fluentui/tree/master/packages/web-components). An implementation of all the current Fluent Web Components can be found at https://aka.ms/fluentwebcomponents.

## Getting Started

Expand Down
30 changes: 15 additions & 15 deletions examples/FluentUIServerSample/Components/FluentDataGridTest.razor
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@

<h2>Sorting/Filtering grid</h2>
<FluentTextField @oninput="FilterChanged">Filter Fruit</FluentTextField>
<FluentDataGrid id="sortingGrid" GridTemplateColumns="1fr 1fr 1fr 1fr" RowsData=SortedRowsGrid ColumnDefinitions=SortingColumnsGrid>
<FluentDataGrid id="sortingGrid" GridTemplateColumns="1fr 1fr 1fr" RowsData=SortedRowsGrid ColumnDefinitions=SortingColumnsGrid>
<HeaderCellTemplate >
<FluentButton @onclick=@(()=>SortColumn(context))>
@context.Title
@context.Title
@if (context.Title == lastSortColumn?.Title)
{
@(isAscending ? " ↑" : " ↓")
@(isAscending ? " ↑" : " ↓")
}
</FluentButton>
</HeaderCellTemplate>
Expand Down Expand Up @@ -73,21 +73,21 @@
private bool isAscending = false;
public string filterValue = "";

List<SampleGrid1Data> RowsGrid1 = new List<SampleGrid1Data>()
List<SampleGrid1Data> RowsGrid1 = new()
{
new SampleGrid1Data("Rob", 19 ),
new SampleGrid1Data("Bob", 20 )
};

List<SampleGrid2Data> RowsGrid2 = new List<SampleGrid2Data>()
List<SampleGrid2Data> RowsGrid2 = new()
{
new SampleGrid2Data("value 1-1", "value 2-1", "value 3-1", "value 4-1" ),
new SampleGrid2Data("value 1-2", "value 2-2", "value 3-2", "value 4-2" ),
new SampleGrid2Data("value 1-3", "value 2-3", "value 3-3", "value 4-3" ),
new SampleGrid2Data("value 1-4", "value 2-4", "value 3-4", "value 4-4" )

};

List<SampleGrid3Data> RawSortedRowsGrid = new List<SampleGrid3Data>()
{
new SampleGrid3Data("apples", "$1.50", "red" ),
Expand All @@ -96,7 +96,7 @@
new SampleGrid3Data("oranges", "$1.25", "orange" )

};
List<SampleGrid3Data> SortedRowsGrid;
List<SampleGrid3Data> SortedRowsGrid = new();


protected override void OnInitialized()
Expand All @@ -112,7 +112,7 @@
SortingColumnsGrid.Add(new ColumnDefinition<SampleGrid3Data>("Fruit", x => x.fruit));
SortingColumnsGrid.Add(new ColumnDefinition<SampleGrid3Data>("Cost", x => x.cost));
SortingColumnsGrid.Add(new ColumnDefinition<SampleGrid3Data>("Color", x => x.color));

SortedRowsGrid = RawSortedRowsGrid;

base.OnInitialized();
Expand All @@ -121,7 +121,7 @@
private void FilterChanged(ChangeEventArgs args)
{
var filter = args.Value as string;

if (string.IsNullOrWhiteSpace(filter))
{
SortedRowsGrid = RawSortedRowsGrid;
Expand All @@ -132,9 +132,9 @@
}
if (lastSortColumn != null)
{
SortedRowsGrid.Sort(new CustomComparer(lastSortColumn.FieldSelector, isAscending));
SortedRowsGrid.Sort(new CustomComparer(lastSortColumn.FieldSelector!, isAscending));
}

}

private void SortColumn(ColumnDefinition<SampleGrid3Data> columnDefinition)
Expand All @@ -148,7 +148,7 @@
lastSortColumn = columnDefinition;
isAscending = true;
}
SortedRowsGrid.Sort(new CustomComparer(columnDefinition.FieldSelector, isAscending));
SortedRowsGrid.Sort(new CustomComparer(columnDefinition.FieldSelector!, isAscending));
}

class CustomComparer : IComparer<SampleGrid3Data>
Expand All @@ -162,10 +162,10 @@
_isAscending = isAscending;
}

int IComparer<SampleGrid3Data>.Compare(SampleGrid3Data x, SampleGrid3Data y)
int IComparer<SampleGrid3Data>.Compare(SampleGrid3Data? x, SampleGrid3Data? y)
{
var xs = _selector(x) as string;
var ys = _selector(y) as string;
var xs = _selector(x!) as string;
var ys = _selector(y!) as string;
if (xs == null || ys == null)
return 0;
return string.Compare(xs, ys) * (_isAscending ? 1 : -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<button @onclick="OnOpenModalParameterButtonClick">Open dialog with variable</button>

@code{
private FluentDialog MyFluentDialog;
private FluentDialog? MyFluentDialog;
public bool ModalHidden { get; set; } = true;


private void OnOpenModalRefButtonClick() => MyFluentDialog.Show();
private void OnCloseModalRefButtonClick() => MyFluentDialog.Hide();
private void OnOpenModalRefButtonClick() => MyFluentDialog!.Show();
private void OnCloseModalRefButtonClick() => MyFluentDialog!.Hide();

private void OnOpenModalParameterButtonClick() => ModalHidden = false;
private void OnCloseModalParameterButtonClick() => ModalHidden = true;
Expand Down
22 changes: 0 additions & 22 deletions examples/FluentUIServerSample/Components/FluentSwitchTest.razor
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
<div style="
direction: ltr;
display: grid;
grid-auto-flow: column;
grid-template-columns: min-content;
grid-gap: 12px;
">
<script suppress-error='BL9992'>
darkTheme = false;
</script>
<FluentSwitch onclick="document.dir = document.dir === 'rtl' ? 'ltr' : 'rtl'; document.getElementsByTagName('fluent-design-system-provider')[0].setAttribute('direction', document.dir);">
<span style="padding-inline-end: 8px;">Direction</span>
<span slot="unchecked-message">ltr</span>
<span slot="checked-message">rtl</span>
</FluentSwitch>

<FluentSwitch onclick="document.darkTheme = !document.darkTheme; document.getElementsByTagName('fluent-design-system-provider')[0].setAttribute('background-color', darkTheme ? '#333333' : '#F7F7F7');">
<span style="padding-inline-end: 8px;"> Theme</span>
<span slot="checked-message">Dark</span>
<span slot="unchecked-message">Light</span>
</FluentSwitch>
</div>
<h1>Switch</h1>
<h4>Default</h4>
<div style="display: flex; flex-direction: column;">
Expand Down
6 changes: 3 additions & 3 deletions examples/FluentUIServerSample/FluentUIServerSample.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
ο»Ώ<Project Sdk="Microsoft.NET.Sdk.Web">

<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Fast.Components.FluentUI\Microsoft.Fast.Components.FluentUI.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RuntimeFrameworkVersion>5.0.10</RuntimeFrameworkVersion>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
10 changes: 5 additions & 5 deletions examples/FluentUIServerSample/Pages/ComponentBindings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,22 @@
private class FormModel
{
[Required]
public string SelectValue { get; set; }
public string? SelectValue { get; set; }

[Required]
public string TextFieldValue { get; set; }
public string? TextFieldValue { get; set; }

[Required]
public int? NumberFieldValue { get; set; }

[Required]
public string TextAreaValue { get; set; }
public string? TextAreaValue { get; set; }

[Required]
public string ComboboxValue { get; set; }
public string? ComboboxValue { get; set; }

[Required]
public string RadioGroupValue { get; set; }
public string? RadioGroupValue { get; set; }

[Required]
public bool CheckboxValue { get; set; }
Expand Down
10 changes: 3 additions & 7 deletions examples/FluentUIServerSample/Pages/Error.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
ο»Ώusing System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
ο»Ώusing Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using System.Diagnostics;

namespace FluentUIServerSample.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string RequestId { get; set; }
public string? RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);

Expand Down
21 changes: 10 additions & 11 deletions examples/FluentUIServerSample/Pages/RawBindings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@
</div>

@code {
string TextFieldValueImplicit;
string TextFieldValueExplicit;
string? TextFieldValueImplicit;
string? TextFieldValueExplicit;
int NumberFieldValueImplicit;
int NumberFieldValueExplicit;
string TextAreaValueImplicit;
string TextAreaValueExplicit;
string? TextAreaValueImplicit;
string? TextAreaValueExplicit;
bool CheckboxValueImplicit;
bool CheckboxValueExplicit;
bool SwitchValueImplicit;
Expand All @@ -135,13 +135,12 @@
bool FluentMenuItemValueExplicit;
int SliderValueImplicit;
int SliderValueExplicit;
string SelectValueImplicit;
string SelectValueExplicit;
string RadioGroupValueImplicit;
string RadioGroupValueExplicit;
string? SelectValueImplicit;
string? SelectValueExplicit;
string? RadioGroupValueImplicit;
string? RadioGroupValueExplicit;
int ListboxIndexValueImplicit;
int ListboxIndexValueExplicit;
string ComboboxValueImplicit;
string ComboboxValueExplicit;

string? ComboboxValueImplicit;
string? ComboboxValueExplicit;
}
Loading