From 3565052c45b3fa50ee0b063b639ac2ee1192fdcc Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 15 Mar 2025 20:06:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=98=E9=87=8F=E6=94=B9=E7=94=A8=E7=A7=81=E6=9C=89?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Select/Select.razor | 2 +- src/BootstrapBlazor/Components/Select/Select.razor.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BootstrapBlazor/Components/Select/Select.razor b/src/BootstrapBlazor/Components/Select/Select.razor index f41bc4f7ff9..2a22b35824f 100644 --- a/src/BootstrapBlazor/Components/Select/Select.razor +++ b/src/BootstrapBlazor/Components/Select/Select.razor @@ -48,7 +48,7 @@ } else { - + } } diff --git a/src/BootstrapBlazor/Components/Select/Select.razor.cs b/src/BootstrapBlazor/Components/Select/Select.razor.cs index 8001f578e9e..6d7e87e5176 100644 --- a/src/BootstrapBlazor/Components/Select/Select.razor.cs +++ b/src/BootstrapBlazor/Components/Select/Select.razor.cs @@ -144,9 +144,6 @@ public partial class Select : ISelect, ILookup [Parameter] public bool DisableItemChangedWhenFirstRender { get; set; } - [NotNull] - private Virtualize? VirtualizeElement { get; set; } - /// /// Gets or sets the bound data set. /// @@ -247,6 +244,9 @@ public partial class Select : ISelect, ILookup /// protected override string? RetrieveId() => InputId; + [NotNull] + private Virtualize? _virtualizeElement = default; + private string? InputId => $"{Id}_input"; private string _lastSelectedValueString = string.Empty; @@ -409,7 +409,7 @@ private async Task RefreshVirtualizeElement() if (IsVirtualize && OnQueryAsync != null) { // 通过 ItemProvider 提供数据 - await VirtualizeElement.RefreshDataAsync(); + await _virtualizeElement.RefreshDataAsync(); } } @@ -556,7 +556,7 @@ private async Task OnClearValue() if (OnQueryAsync != null) { - await VirtualizeElement.RefreshDataAsync(); + await _virtualizeElement.RefreshDataAsync(); } _lastSelectedValueString = string.Empty; From 6aa99a3a5e0578e8ad78cec1d330fe4a80522933 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 15 Mar 2025 20:46:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=E6=96=87=E6=A1=A3=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=9B=B4=E6=94=B9=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Select/SelectBase.cs | 43 ++++++++++--------- .../Components/Select/SelectOption.cs | 21 ++++----- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/BootstrapBlazor/Components/Select/SelectBase.cs b/src/BootstrapBlazor/Components/Select/SelectBase.cs index 467a044add8..c1e20e4a8e3 100644 --- a/src/BootstrapBlazor/Components/Select/SelectBase.cs +++ b/src/BootstrapBlazor/Components/Select/SelectBase.cs @@ -6,99 +6,100 @@ namespace BootstrapBlazor.Components; /// -/// SelectBase 组件基类 +/// SelectBase component base class /// +/// The type of the value. public abstract class SelectBase : PopoverSelectBase { /// - /// 获得/设置 颜色 默认 Color.None 无设置 + /// Gets or sets the color. The default is (no color). /// [Parameter] public Color Color { get; set; } /// - /// 获得/设置 是否显示搜索框 默认为 false 不显示 + /// Gets or sets a value indicating whether to show the search box. The default is false. /// [Parameter] public bool ShowSearch { get; set; } /// - /// 获得/设置 设置搜索图标 + /// Gets or sets the search icon. /// [Parameter] public string? SearchIcon { get; set; } /// - /// 获得/设置 设置正在搜索图标 + /// Gets or sets the search loading icon. /// [Parameter] public string? SearchLoadingIcon { get; set; } /// - /// 获得/设置 搜索框文本 + /// Gets or sets the search text. /// [NotNull] protected string? SearchText { get; set; } /// - /// 获得/设置 无搜索结果时显示文字 + /// Gets or sets the text to display when no search results are found. /// [Parameter] public string? NoSearchDataText { get; set; } /// - /// 获得/设置 右侧下拉箭头图标 默认 fa-solid fa-angle-up + /// Gets or sets the dropdown icon. The default is "fa-solid fa-angle-up". /// [Parameter] [NotNull] public string? DropdownIcon { get; set; } /// - /// 获得/设置 是否为 MarkupString 默认 false + /// Gets or sets a value indicating whether the content is a . The default is false. /// [Parameter] public bool IsMarkupString { get; set; } /// - /// 获得/设置 字符串比较规则 默认 StringComparison.OrdinalIgnoreCase 大小写不敏感 + /// Gets or sets the string comparison rule. The default is . /// [Parameter] public StringComparison StringComparison { get; set; } = StringComparison.OrdinalIgnoreCase; /// - /// 获得/设置 分组项模板 + /// Gets or sets the group item template. /// [Parameter] public RenderFragment? GroupItemTemplate { get; set; } /// - /// 获得/设置 滚动行为 默认 + /// Gets or sets the scroll behavior. The default is . /// [Parameter] public ScrollIntoViewBehavior ScrollIntoViewBehavior { get; set; } = ScrollIntoViewBehavior.Smooth; /// - /// 获得/设置 IIconTheme 服务实例 + /// Gets or sets the service instance. /// [Inject] [NotNull] protected IIconTheme? IconTheme { get; set; } /// - /// 获得 PlaceHolder 属性 + /// Gets or sets the placeholder text. /// [Parameter] public string? PlaceHolder { get; set; } /// - /// 获得 SearchIcon 图标字符串 默认增加 icon 样式 + /// Gets the search icon string with default "icon search-icon" class. /// protected string? SearchIconString => CssBuilder.Default("icon search-icon") .AddClass(SearchIcon) .Build(); /// - /// + /// Gets the custom class string. /// protected override string? CustomClassString => CssBuilder.Default() .AddClass("select", IsPopover) @@ -106,7 +107,7 @@ public abstract class SelectBase : PopoverSelectBase .Build(); /// - /// 获得 样式集合 + /// Gets the append class string. /// protected string? AppendClassString => CssBuilder.Default("form-select-append") .AddClass($"text-{Color.ToDescriptionString()}", Color != Color.None && !IsDisabled && !IsValid.HasValue) @@ -126,14 +127,14 @@ protected override void OnParametersSet() } /// - /// 显示下拉框方法 + /// Shows the dropdown. /// - /// + /// A representing the asynchronous operation. public Task Show() => InvokeVoidAsync("show", Id); /// - /// 关闭下拉框方法 + /// Hides the dropdown. /// - /// + /// A representing the asynchronous operation. public Task Hide() => InvokeVoidAsync("hide", Id); } diff --git a/src/BootstrapBlazor/Components/Select/SelectOption.cs b/src/BootstrapBlazor/Components/Select/SelectOption.cs index 4841fb76b4f..5e4180a1bbc 100644 --- a/src/BootstrapBlazor/Components/Select/SelectOption.cs +++ b/src/BootstrapBlazor/Components/Select/SelectOption.cs @@ -6,48 +6,45 @@ namespace BootstrapBlazor.Components; /// -/// SelectOption 组件 +/// SelectOption component /// public class SelectOption : ComponentBase { /// - /// 获得/设置 显示名称 + /// Gets or sets the display name. /// [Parameter] public string? Text { get; set; } /// - /// 获得/设置 选项值 + /// Gets or sets the option value. /// [Parameter] public string? Value { get; set; } /// - /// 获得/设置 是否选中 默认 false + /// Gets or sets a value indicating whether the option is selected. Default is false. /// [Parameter] public bool Active { get; set; } /// - /// 获得/设置 是否禁用 默认 false + /// Gets or sets a value indicating whether the option is disabled. Default is false. /// [Parameter] public bool IsDisabled { get; set; } /// - /// 获得/设置 分组名称 + /// Gets or sets the group name. /// [Parameter] public string? GroupName { get; set; } - /// - /// 父组件通过级联参数获得 - /// [CascadingParameter] private ISelect? Container { get; set; } /// - /// OnInitialized 方法 + /// /// protected override void OnInitialized() { @@ -56,6 +53,10 @@ protected override void OnInitialized() Container?.Add(ToSelectedItem()); } + /// + /// Converts the current instance to a . + /// + /// A instance. private SelectedItem ToSelectedItem() => new() { Active = Active, From 61cb2dd4f18aec491d4e570d6884c8af3afcab9d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 16 Mar 2025 11:16:10 +0800 Subject: [PATCH 3/3] chore: bump version 9.4.9-beta09 Co-Authored-By: trycatchfinnally <37445968+trycatchfinnally@users.noreply.github.com> --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index b795e294dd3..6b632e85feb 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.4.9-beta08 + 9.4.9-beta09