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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Install GitVersion
run: dotnet tool install GitVersion.Tool --global --version 5.*
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Download artifacts
uses: actions/download-artifact@v4
Expand All @@ -90,7 +90,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down
13 changes: 6 additions & 7 deletions Mimeo.DynamicUI.Blazor.Tests/Mimeo.DynamicUI.Blazor.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -10,18 +10,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageReference Include="System.Linq.Async" Version="7.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PackageReference Include="coverlet.collector" Version="10.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.v3" Version="3.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
91 changes: 46 additions & 45 deletions Mimeo.DynamicUI.Blazor/Controls/DataSourceDropDownGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@
@if (Multiple)
{
<CustomRadzenDropDownDataGrid TValue="IEnumerable<TValue>" id="@Id" @ref="gridRefMulti"
AllowClear="true"
Multiple="true"
Chips="true"
SelectedValue="defaultSelectedItems"
Value="Values"
ValueChanged="OnValuesChanged"
Data="gridItems"
Count="gridCount"
Placeholder="@Placeholder"
LoadData="OnGridLoadData"
ValueProperty="@nameof(GridItem.Value)"
AllowFiltering="true"
OnOpenPopup="OnOpenPopup"
Disabled="Disabled"
Density="Density.Compact"
IsLoading="isLoading"
MaxSelectedLabels="@int.MaxValue"
OnChipRemoveOverride="OnChipRemove">
Name="@Name"
AllowClear="true"
Multiple="true"
Chips="true"
SelectedValue="defaultSelectedItems"
Value="Values"
ValueChanged="OnValuesChanged"
Data="gridItems"
Count="gridCount"
Placeholder="@Placeholder"
LoadData="OnGridLoadData"
ValueProperty="@nameof(GridItem.Value)"
AllowFiltering="true"
OnOpenPopup="OnOpenPopup"
Disabled="Disabled"
Density="Density.Compact"
IsLoading="isLoading"
MaxSelectedLabels="@int.MaxValue"
OnChipRemoveOverride="OnChipRemove">
<ValueTemplate Context="Item">
@GetViewModelNameByValue(Item.Value)
</ValueTemplate>
<Columns>
<RadzenDropDownDataGridColumn Width="60px" Sortable="false">
<Template Context="data">
<RadzenCheckBox InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "select item" }})" TriState="false" Value="@(Values != null && Values.Contains(GetViewModelValue(data.ListModel)))"
TValue="bool" Change=@(args => gridRefMulti!.SelectItem(data)) @onclick:stopPropagation />
<RadzenCheckBox InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "select item" } })" TriState="false" Value="@(Values != null && Values.Contains(GetViewModelValue(data.ListModel)))"
TValue="bool" Change=@(args => gridRefMulti!.SelectItem(data)) @onclick:stopPropagation />
</Template>
</RadzenDropDownDataGridColumn>
@foreach (var formField in formFields ?? [])
{
<RadzenDropDownDataGridColumn
Property="@formField.PropertyName"
Type="@formField.PropertyType"
Title="@(lang.GetPropertyName(formField))"
Sortable="@formField.Sortable"
SortOrder="@(formField.DefaultSortDirection switch {SortDirection.Ascending => SortOrder.Ascending, SortDirection.Descending => SortOrder.Descending, _ => null})"
Filterable="@formField.Filterable">
<RadzenDropDownDataGridColumn Property="@formField.PropertyName"
Type="@formField.PropertyType"
Title="@(lang.GetPropertyName(formField))"
Sortable="@formField.Sortable"
SortOrder="@(formField.DefaultSortDirection switch {SortDirection.Ascending => SortOrder.Ascending, SortDirection.Descending => SortOrder.Descending, _ => null})"
Filterable="@formField.Filterable">
<Template Context="item">
<DynamicField FormField="@item.ListModel.GetDropDownListForm()[formField.PropertyName]" ReadOnly="true" ViewModel="item.ListModel" CustomFormFieldTypes="CustomFormFieldTypes" />
</Template>
Expand All @@ -55,31 +55,32 @@
else
{
<CustomRadzenDropDownDataGrid TValue="TValue" id="@Id" @ref="gridRef"
AllowClear="true"
Multiple="false"
SelectedItem="@gridSelectedItem"
Value="Value"
ValueChanged="OnValueChanged"
Data="gridItems"
Count="gridCount"
Placeholder="@Placeholder"
LoadData="OnGridLoadData"
ValueProperty="@nameof(GridItem.Value)"
AllowFiltering="true"
OnOpenPopup="OnOpenPopup"
Disabled="Disabled">
Name="@Name"
AllowClear="true"
Multiple="false"
SelectedItem="@gridSelectedItem"
Value="Value"
ValueChanged="OnValueChanged"
Data="gridItems"
Count="gridCount"
Placeholder="@Placeholder"
LoadData="OnGridLoadData"
ValueProperty="@nameof(GridItem.Value)"
AllowFiltering="true"
OnOpenPopup="OnOpenPopup"
Disabled="Disabled">
<ValueTemplate Context="Item">
@GetViewModelNameByValue(Item.Value)
</ValueTemplate>
<Columns>
@foreach (var formField in formFields ?? [])
{
<RadzenDropDownDataGridColumn Property="@formField.PropertyName"
Type="@formField.PropertyType"
Title="@(lang.GetPropertyName(formField))"
Sortable="@formField.Sortable"
SortOrder="@(formField.DefaultSortDirection switch {SortDirection.Ascending => SortOrder.Ascending, SortDirection.Descending => SortOrder.Descending, _ => null})"
Filterable="@formField.Filterable">
Type="@formField.PropertyType"
Title="@(lang.GetPropertyName(formField))"
Sortable="@formField.Sortable"
SortOrder="@(formField.DefaultSortDirection switch {SortDirection.Ascending => SortOrder.Ascending, SortDirection.Descending => SortOrder.Descending, _ => null})"
Filterable="@formField.Filterable">
<Template Context="item">
<DynamicField FormField="@item.ListModel.GetDropDownListForm()[formField.PropertyName]" ReadOnly="true" ViewModel="item.ListModel" CustomFormFieldTypes="CustomFormFieldTypes" />
</Template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Mimeo.DynamicUI.Data;
using Mimeo.DynamicUI.Data.OData;
using Radzen;
using System.Reflection;

namespace Mimeo.DynamicUI.Blazor.Controls
{
Expand All @@ -19,6 +18,9 @@ public partial class DataSourceDropDownGrid<TValue>
[Parameter]
public string? Id { get; set; }

[Parameter]
public string? Name { get; set; }

[Parameter]
public TValue? Value { get; set; }

Expand Down Expand Up @@ -290,6 +292,9 @@ private async Task OnValueChanged(TValue value)
{
Value = value;
await ValueChanged.InvokeAsync(value);

gridSelectedItem = null;
await LoadSelectedItems(gridItems.Select(g => g.ListModel));
}

private async Task OnValuesChanged(IEnumerable<TValue?>? values)
Expand Down
2 changes: 1 addition & 1 deletion Mimeo.DynamicUI.Blazor/DefaultLanguage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Mimeo.DynamicUI.Blazor/DialogServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class DialogServiceExtensions
{
public static async Task<bool?> OpenEditDialogAsync(this DialogService dialogService, string title, ViewModel viewModel, string width = "1000px", Dictionary<string, Type>? customFormFieldTypes = null)
{
var result = await dialogService.OpenAsync<DynamicEditForm>(title, new Dictionary<string, object>
var result = await dialogService.OpenAsync<DynamicEditForm>(title, new Dictionary<string, object?>
{
{ nameof(DynamicEditForm.ViewModel), viewModel },
{ nameof(DynamicEditForm.IsModal), true },
Expand Down Expand Up @@ -41,7 +41,7 @@ public static class DialogServiceExtensions

public static async Task<bool?> OpenViewDialogAsync(this DialogService dialogService, string title, ViewModel viewModel, string width = "1000px", Dictionary<string, Type>? customFormFieldTypes = null)
{
var result = await dialogService.OpenAsync<DynamicView>(title, new Dictionary<string, object>
var result = await dialogService.OpenAsync<DynamicView>(title, new Dictionary<string, object?>
{
{ nameof(DynamicView.ViewModel), viewModel },
{ nameof(DynamicView.IsModal), true },
Expand Down
4 changes: 2 additions & 2 deletions Mimeo.DynamicUI.Blazor/Forms/InlineEditGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
<RadzenButton Icon="add_circle_outline" style="margin-top:1em;margin-bottom:1em;" Text="@lang.GetValueOrDefault("add")" Click="InsertRow" Disabled=@(itemToInsert != null) />
}

<MediaQuery Media="@Breakpoints.LargeUp" @bind-Matches="IsLarge" />
<MediaQuery Media="@Breakpoints.SmallDown" @bind-Matches="IsSmall" />
<RadzenMediaQuery Query="(min-width: 992px)" Change="@(matches => IsLarge = matches)" />
<RadzenMediaQuery Query="(max-width: 767.98px)" Change="@(matches => IsSmall = matches)" />

@code {
[Parameter]
Expand Down
4 changes: 2 additions & 2 deletions Mimeo.DynamicUI.Blazor/Forms/ODataGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ Density="@Density">
</Columns>
</CustomRadzenDataGrid>

<MediaQuery Media="@Breakpoints.LargeUp" @bind-Matches="IsLarge" />
<MediaQuery Media="@Breakpoints.SmallDown" @bind-Matches="IsSmall" />
<RadzenMediaQuery Query="(min-width: 992px)" Change="@(matches => IsLarge = matches)" />
<RadzenMediaQuery Query="(max-width: 767.98px)" Change="@(matches => IsSmall = matches)" />
110 changes: 59 additions & 51 deletions Mimeo.DynamicUI.Blazor/Mimeo.DynamicUI.Blazor.csproj
Original file line number Diff line number Diff line change
@@ -1,55 +1,63 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Blazor library to create UIs using view models from Mimeo.DynamicUI</Description>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>


<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BlazorMonaco" Version="3.3.0" />
<PackageReference Include="BlazorPro.BlazorSize" Version="8.0.0" />
<PackageReference Include="CsvHelper" Version="33.1.0" />
<PackageReference Include="DecimalMath.DecimalEx" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.15" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.15" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.7" />
<PackageReference Include="NodaTime" Version="3.2.2" />
<PackageReference Include="Radzen.Blazor" Version="7.0.8" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Mimeo.DynamicUI\Mimeo.DynamicUI.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="DefaultLanguage.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>DefaultLanguage.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="DefaultLanguage.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DefaultLanguage.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Blazor library to create UIs using view models from Mimeo.DynamicUI</Description>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BlazorMonaco" Version="3.4.0" />
<PackageReference Include="CsvHelper" Version="33.1.0" />
<PackageReference Include="DecimalMath.DecimalEx" Version="1.0.2" />
<PackageReference Include="NodaTime" Version="3.3.2" />
<PackageReference Include="Radzen.Blazor" Version="10.3.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.26" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.26" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.26" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.26" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="10.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="10.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.7" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="10.0.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Mimeo.DynamicUI\Mimeo.DynamicUI.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="DefaultLanguage.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>DefaultLanguage.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="DefaultLanguage.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DefaultLanguage.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion Mimeo.DynamicUI.Blazor/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
@using Mimeo.DynamicUI.Data
@using Radzen
@using Radzen.Blazor
@using BlazorPro.BlazorSize

@inject IStringLocalizer lang
Loading
Loading