Compare commits

...

16 Commits

Author SHA1 Message Date
Vladimir Enchev
3ac46f239e Version updated 2024-10-10 14:56:48 +03:00
Vladimir Enchev
1e106f7ada DataPicker rz-readonly should be added only when ReadOnly=true 2024-10-10 14:56:32 +03:00
Vladimir Enchev
09738b2dd7 added version to blazor.web.js 2024-10-10 13:48:00 +03:00
Vladimir Enchev
dc67a0b0fc Version updated 2024-10-10 08:57:59 +03:00
Atanas Korchev
1258bbc770 RadzenDataAnnotationValidator supports nested properties. 2024-10-09 18:59:27 +03:00
Victor Ureta
5960318a60 Add same color to datepicker button as text (#1730)
* Update RadzenDatePicker.razor

* Update RadzenDatePicker.razor

* add ButtonClass
2024-10-09 13:33:37 +03:00
Vladimir Enchev
d4faf758f4 DataGrid will not render items when virtualized and grouped in some cases 2024-10-09 13:33:07 +03:00
Vladimir Enchev
f88216b9a0 ReadOnly Datepicker with PopupRenderMode Initial allows user to open popup and select date
Fix #1727
2024-10-09 11:41:04 +03:00
Vladimir Enchev
e21d648588 Closing tooltip should not try to restore focus 2024-10-09 09:04:33 +03:00
Vladimir Enchev
dbcbdc9bbc comment fixed
Fix #1729
2024-10-08 16:17:28 +03:00
Vladimir Enchev
c5d16e8381 FormatString added to DateTime column in Dialog demo 2024-10-08 16:13:36 +03:00
Vladimir Enchev
ac1aa6f3b1 dates updated 2024-10-08 16:09:20 +03:00
Vladimir Enchev
866c222c74 DropDown will not select item on Enter is some cases 2024-10-08 13:34:39 +03:00
Vladimir Enchev
06843477cb Index property added to DataGrid RowRenderEventArgs 2024-10-08 13:34:39 +03:00
Vladimir Enchev
9a7a6fc6ab DataGrid will group by wrong column in case of invisible columns 2024-10-08 13:34:38 +03:00
Atanas Korchev
4986da415f Some data grid grouping demos are not editable. 2024-10-08 08:10:09 +03:00
15 changed files with 447 additions and 430 deletions

View File

@@ -758,6 +758,11 @@ namespace Radzen
/// </summary>
/// <value><c>true</c> if expandable; otherwise, <c>false</c>.</value>
public bool Expandable { get; set; }
/// <summary>
/// Gets or sets a value indicating row index.
/// </summary>
public int Index { get; set; }
}
/// <summary>

View File

@@ -675,8 +675,10 @@ namespace Radzen
if (selectedIndex >= 0 && selectedIndex <= items.Count() - 1)
{
await JSRuntime.InvokeAsync<string>("Radzen.setInputValue", search, $"{searchText}".Trim());
var itemToSelect = items.ElementAtOrDefault(selectedIndex);
await JSRuntime.InvokeAsync<string>("Radzen.setInputValue", search, $"{searchText}".Trim());
if (itemToSelect != null)
{
await OnSelectItem(itemToSelect, true);

View File

@@ -10,7 +10,7 @@
<IsPackable>true</IsPackable>
<PackageId>Radzen.Blazor</PackageId>
<Product>Radzen.Blazor</Product>
<Version>5.2.10</Version>
<Version>5.2.12</Version>
<Copyright>Radzen Ltd.</Copyright>
<Authors>Radzen Ltd.</Authors>
<Description>Radzen Blazor is a set of 90+ free native Blazor UI controls packed with DataGrid, Scheduler, Charts and robust theming including Material design and Fluent UI.</Description>

View File

@@ -48,11 +48,13 @@ namespace Radzen.Blazor
{
var validationResults = new List<ValidationResult>();
var getter = PropertyAccess.Getter<object>(EditContext.Model, component.FieldIdentifier.FieldName);
var model = component.FieldIdentifier.Model;
var value = getter(EditContext.Model);
var getter = PropertyAccess.Getter<object>(model, component.FieldIdentifier.FieldName);
var validationContext = new ValidationContext(EditContext.Model)
var value = getter(model);
var validationContext = new ValidationContext(model)
{
MemberName = component.FieldIdentifier.FieldName
};

View File

@@ -141,12 +141,12 @@ namespace Radzen.Blazor
if (Groups.Any())
{
query = view.AsQueryable().OrderBy(DynamicLinqCustomTypeProvider.ParsingConfig, Groups.Any() ? string.Join(',', Groups.Select(g => $"{(typeof(TItem) == typeof(object) ? g.Property : "np(" + g.Property + ")")}")) : "it");
_groupedPagedView = query.GroupByMany(DynamicLinqCustomTypeProvider.ParsingConfig, Groups.Any() ? Groups.Select(g => $"{(typeof(TItem) == typeof(object) ? g.Property : "np(" + g.Property + ")")}").ToArray() : new string[] { "it" }).ToList();
_groupedPagedView = await Task.FromResult(query.GroupByMany(DynamicLinqCustomTypeProvider.ParsingConfig, Groups.Any() ? Groups.Select(g => $"{(typeof(TItem) == typeof(object) ? g.Property : "np(" + g.Property + ")")}").ToArray() : new string[] { "it" }).ToList());
totalItemsCount = await Task.FromResult(_groupedPagedView.Count());
}
_view = Enumerable.Empty<TItem>().AsQueryable();
_view = view;
return new Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderResult<GroupResult>(_groupedPagedView.Any() ? _groupedPagedView.Skip(request.StartIndex).Take(top) : _groupedPagedView, totalItemsCount);
}
@@ -2278,9 +2278,9 @@ namespace Radzen.Blazor
return (RowSelect.HasDelegate || ValueChanged.HasDelegate || SelectionMode == DataGridSelectionMode.Multiple) && selectedItems.Keys.Any(i => ItemEquals(i, item)) ? $"rz-state-highlight rz-data-row {isInEditMode} " : $"rz-data-row {isInEditMode} ";
}
internal Tuple<Radzen.RowRenderEventArgs<TItem>, IReadOnlyDictionary<string, object>> RowAttributes(TItem item)
internal Tuple<Radzen.RowRenderEventArgs<TItem>, IReadOnlyDictionary<string, object>> RowAttributes(TItem item, int index)
{
var args = new Radzen.RowRenderEventArgs<TItem>() { Data = item, Expandable = Template != null || LoadChildData.HasDelegate };
var args = new Radzen.RowRenderEventArgs<TItem>() { Data = item, Index = index, Expandable = Template != null || LoadChildData.HasDelegate };
if (RowRender != null)
{
@@ -3104,7 +3104,7 @@ namespace Radzen.Blazor
var functionName = $"Radzen['{getColumnUniqueId(indexOfColumnToReoder.Value)}end']";
await JSRuntime.InvokeVoidAsync("eval", $"{functionName} && {functionName}()");
var column = allColumns.ElementAtOrDefault(indexOfColumnToReoder.Value);
var column = allColumns.Where(c => c.Visible).ToList().ElementAtOrDefault(indexOfColumnToReoder.Value);
if (column != null && column.Groupable && !string.IsNullOrEmpty(column.GetGroupProperty()))
{

View File

@@ -3,7 +3,7 @@
@implements IRadzenForm
<CascadingValue Value=@EditContext>
<CascadingValue Value=this>
@{var rowArgs = Grid?.RowAttributes(Item); }
@{var rowArgs = Grid?.RowAttributes(Item, Index); }
@{var firstLevel = Grid.AllowCompositeDataCells ? 0 : Grid.deepestChildColumnLevel; }
@for(var i = firstLevel; i < Grid.deepestChildColumnLevel + 1; i++)
{

View File

@@ -15,10 +15,10 @@
{
<input @ref="@input" @attributes="InputAttributes" disabled="@Disabled" readonly="@IsReadonly" value="@FormattedValue" tabindex="@(Disabled ? "-1" : $"{TabIndex}")"
@onchange="@ParseDate" autocomplete="off" type="text" name="@Name" @onkeydown="@(args => OnKeyPress(args))" @onkeydown:preventDefault=preventKeyPress @onkeydown:stopPropagation
class="rz-inputtext @InputClass @(IsReadonly ? "rz-readonly" : "") @(!ShowButton ? "rz-input-trigger" : "")" id="@Name" placeholder="@Placeholder" />
class="rz-inputtext @InputClass @(ReadOnly ? "rz-readonly" : "") @(!ShowButton ? "rz-input-trigger" : "")" id="@Name" placeholder="@Placeholder" />
@if (ShowButton)
{
<button aria-label="@ToggleAriaLabel" @onmousedown=@OnToggle class="@($"rz-datepicker-trigger rz-button rz-button-icon-only{(Disabled ? " rz-state-disabled" : "")}")" tabindex="-1" type="button">
<button aria-label="@ToggleAriaLabel" @onmousedown=@OnToggle class="@($"rz-datepicker-trigger rz-button rz-button-icon-only{(Disabled ? " rz-state-disabled" : "")} {ButtonClass}")" tabindex="-1" type="button">
<span aria-hidden="true" class="@ButtonClasses"></span><span class="rz-button-text"></span>
</button>
}

View File

@@ -316,6 +316,12 @@ namespace Radzen.Blazor
/// <value>The input CSS class.</value>
[Parameter]
public string InputClass { get; set; }
/// <summary>
/// Gets or sets the button CSS class.
/// </summary>
/// <value>The button CSS class.</value>
[Parameter]
public string ButtonClass { get; set; }
/// <summary>
/// Gets or sets the Minimum Selectable Date.

View File

@@ -6,7 +6,7 @@ using System.Text;
namespace Radzen.Blazor
{
/// <summary>
/// RadzenCard component.
/// RadzenStack component.
/// </summary>
public partial class RadzenStack : RadzenFlexComponent
{

View File

@@ -991,6 +991,7 @@ window.Radzen = {
}
},
closeTooltip(id) {
Radzen.activeElement = null;
Radzen.closePopup(id);
if (Radzen[id + 'delay']) {
@@ -1022,16 +1023,17 @@ window.Radzen = {
}
};
var input = el.querySelector('.rz-inputtext');
var button = el.querySelector('.rz-datepicker-trigger');
if (button) {
button.onclick = function (e) {
handler(e, !e.currentTarget.classList.contains('rz-state-disabled'));
handler(e, !e.currentTarget.classList.contains('rz-state-disabled') && (input ? !input.classList.contains('rz-readonly') : true));
};
}
var input = el.querySelector('.rz-inputtext');
if (input) {
input.onclick = function (e) {
handler(e, e.currentTarget.classList.contains('rz-readonly') || e.currentTarget.classList.contains('rz-input-trigger') );
handler(e, e.currentTarget.classList.contains('rz-input-trigger') && !e.currentTarget.classList.contains('rz-readonly'));
};
}
},

View File

@@ -44,7 +44,7 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.web.js"></script>
<script src="_framework/blazor.web.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
<script async src="js/highlight.pack.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
<script defer data-domain="blazor.radzen.com" src="https://analytics.radzen.com/js/plausible.js"></script>

View File

@@ -43,7 +43,7 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.web.js"></script>
<script src="_framework/blazor.web.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
<script async src="js/highlight.pack.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
<script defer data-domain="blazor.radzen.com" src="https://analytics.radzen.com/js/plausible.js"></script>

File diff suppressed because it is too large Load Diff

View File

@@ -40,7 +40,7 @@
Data="@(orderDetails.Where(o => o.OrderID == OrderID))" ColumnWidth="200px" Density="Density.Compact" AllowAlternatingRows="false">
<Columns>
<RadzenDataGridColumn Property="@nameof(OrderDetail.Quantity)" Title="Quantity" />
<RadzenDataGridColumn Property="Order.OrderDate" Title="Order Date" />
<RadzenDataGridColumn Property="Order.OrderDate" Title="Order Date" FormatString="{0:d}" />
<RadzenDataGridColumn Property="@nameof(OrderDetail.Discount)" Title="Discount" FormatString="{0:P}" />
</Columns>
</RadzenDataGrid>

View File

@@ -180,7 +180,7 @@ namespace RadzenBlazorDemos
var csharpDocument = codeDocument.GetCSharpDocument();
var syntaxTree = CSharpSyntaxTree.ParseText(csharpDocument.GeneratedCode, CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
var syntaxTree = CSharpSyntaxTree.ParseText(csharpDocument.GeneratedCode.Replace("<Radzen.Group>", "<global::Radzen.Group>"), CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
compilation = compilation.RemoveAllSyntaxTrees().AddSyntaxTrees(syntaxTree);