diff --git a/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj b/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj index bd9f0fc2..62cb6bb5 100644 --- a/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj +++ b/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj @@ -1,7 +1,7 @@  - 10.0.1 + 10.0.2 diff --git a/src/components/BootstrapBlazor.Region/Components/SelectCity.razor.cs b/src/components/BootstrapBlazor.Region/Components/SelectCity.razor.cs index 9eac13fb..2a24fec9 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectCity.razor.cs +++ b/src/components/BootstrapBlazor.Region/Components/SelectCity.razor.cs @@ -7,31 +7,35 @@ namespace BootstrapBlazor.Components; /// -/// SelectCity 组件 +/// SelectCity 组件 +/// SelectCity component /// public partial class SelectCity { /// - /// 获得/设置 是否可多选 默认 false 单选 + /// 获得/设置 是否可多选,默认 false 单选 + /// Gets or sets whether multiple selection is enabled. Default is false (single selection) /// [Parameter] public bool IsMultiple { get; set; } /// - /// 获得/设置 是否开启搜索功能 默认 true 开启 + /// 获得/设置 是否开启搜索功能,默认 true 开启 + /// Gets or sets whether search is enabled. Default is true /// [Parameter] public bool ShowSearch { get; set; } = true; /// - /// Gets or sets the search icon. + /// 获得/设置 搜索图标 + /// Gets or sets the search icon /// [Parameter] public string? SearchIcon { get; set; } /// - /// 获得/设置 单选时选择后是否自动关闭 默认 true - /// 值为 true 时,这个参数不生效 + /// 获得/设置 单选时选择后是否自动关闭,默认 true 值为 true 时,这个参数不生效 + /// Gets or sets whether to automatically close after selection when single selection is enabled. Default is true. This parameter does not take effect when is true /// [Parameter] public bool AutoClose { get; set; } = true; @@ -87,7 +91,6 @@ protected override void OnParametersSet() /// /// /// - /// protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); @@ -107,17 +110,16 @@ protected override async Task OnAfterRenderAsync(bool firstRender) /// /// /// - /// protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new { TriggerSearch = nameof(TriggerSearch) }); /// - /// 触发过滤方法 由 JavaScript 触发 + /// 触发过滤方法,由 JavaScript 触发 + /// Trigger filter method, invoked by JavaScript /// /// - /// [JSInvokable] public void TriggerSearch(string v) { diff --git a/src/components/BootstrapBlazor.Region/Components/SelectProvince.razor.cs b/src/components/BootstrapBlazor.Region/Components/SelectProvince.razor.cs index e7b075bd..3c7f968c 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectProvince.razor.cs +++ b/src/components/BootstrapBlazor.Region/Components/SelectProvince.razor.cs @@ -1,16 +1,18 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// SelectProvince 组件 +/// SelectProvince 组件 +/// SelectProvince component /// public partial class SelectProvince { /// - /// 获得/设置 是否可多选 默认 false 单选 + /// 获得/设置 是否可多选,默认 false 单选 + /// Gets or sets whether multiple selection is enabled. Default is false (single selection) /// [Parameter] public bool IsMultiple { get; set; } diff --git a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs index d7fd97d3..fc121d9b 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs +++ b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs @@ -1,11 +1,12 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// SelectRegion 组件 +/// SelectRegion 组件 +/// SelectRegion component /// public partial class SelectRegion { diff --git a/src/components/BootstrapBlazor.Region/Components/SelectRegionBase.cs b/src/components/BootstrapBlazor.Region/Components/SelectRegionBase.cs index c2a05f92..dda5c13e 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectRegionBase.cs +++ b/src/components/BootstrapBlazor.Region/Components/SelectRegionBase.cs @@ -1,62 +1,71 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// SelectRegion 组件基类 +/// SelectRegion 组件基类 +/// SelectRegion component base class /// public abstract class SelectRegionBase : PopoverSelectBase { /// - /// Gets or sets the placeholder text. + /// 获得/设置 占位符文本 + /// Gets or sets the placeholder text /// [Parameter] public string? PlaceHolder { get; set; } /// - /// Gets or sets the color. The default is (no color). + /// 获得/设置 颜色,默认为 (无颜色) + /// Gets or sets the color. The default is (no color) /// [Parameter] public Color Color { get; set; } /// - /// Gets or sets the dropdown icon. The default is "fa-solid fa-angle-up". + /// 获得/设置 下拉图标,默认为 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; } /// - /// Gets or sets the callback method when the clear button is clicked. Default is null. + /// 获得/设置 点击清空按钮时的回调方法,默认为 null + /// Gets or sets the callback method when the clear button is clicked. Default is null /// [Parameter] public Func? OnClearAsync { get; set; } /// - /// Gets or sets the right-side clear icon. Default is fa-solid fa-angle-up. + /// 获得/设置 右侧清空图标,默认为 fa-solid fa-angle-up + /// Gets or sets the right-side clear icon. Default is fa-solid fa-angle-up /// [Parameter] [NotNull] public string? ClearIcon { get; set; } /// - /// Gets or sets the service instance. + /// 获得/设置 服务实例 + /// Gets or sets the service instance /// [Inject] [NotNull] protected IIconTheme? IconTheme { get; set; } /// - /// service instance + /// 获得/设置 服务实例 + /// Gets or sets the service instance /// [Inject] [NotNull] protected IRegionService? RegionService { get; set; } /// - /// 文本框样式 + /// 获得 文本框样式 + /// Gets the input box style /// protected string? InputClassString => CssBuilder.Default("form-select form-control") .AddClass($"border-{Color.ToDescriptionString()}", Color != Color.None && !IsDisabled && !IsValid.HasValue) @@ -66,7 +75,8 @@ public abstract class SelectRegionBase : PopoverSelectBase .Build(); /// - /// 下拉框按钮样式 + /// 获得 下拉框按钮样式 + /// Gets the dropdown button style /// protected string? AppendClassString => CssBuilder.Default("form-select-append") .AddClass($"text-{Color.ToDescriptionString()}", Color != Color.None && !IsDisabled && !IsValid.HasValue) @@ -75,7 +85,8 @@ public abstract class SelectRegionBase : PopoverSelectBase .Build(); /// - /// 清空按钮样式 + /// 获得 清空按钮样式 + /// Gets the clear button style /// protected string? ClearClassString => CssBuilder.Default("clear-icon") .AddClass($"text-{Color.ToDescriptionString()}", Color != Color.None) @@ -84,7 +95,8 @@ public abstract class SelectRegionBase : PopoverSelectBase .Build(); /// - /// 获得 选择框组件 Id + /// 获得 选择框组件 Id + /// Gets the select component Id /// protected string InputId => $"{Id}_input"; diff --git a/src/components/BootstrapBlazor.Region/Data/CityItem.cs b/src/components/BootstrapBlazor.Region/Data/CityItem.cs index 3c3a988c..259fedf9 100644 --- a/src/components/BootstrapBlazor.Region/Data/CityItem.cs +++ b/src/components/BootstrapBlazor.Region/Data/CityItem.cs @@ -1,12 +1,24 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; +/// +/// 城市项 +/// City item +/// readonly record struct CityItem { + /// + /// 获得 名称 + /// Gets the name + /// public string Name { get; init; } + /// + /// 获得 拼音集合 + /// Gets the pinyin collection + /// public HashSet PinYin { get; init; } } diff --git a/src/components/BootstrapBlazor.Region/Data/CountyItem.cs b/src/components/BootstrapBlazor.Region/Data/CountyItem.cs index ec498487..132718d5 100644 --- a/src/components/BootstrapBlazor.Region/Data/CountyItem.cs +++ b/src/components/BootstrapBlazor.Region/Data/CountyItem.cs @@ -1,21 +1,24 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// Region 类 +/// 区县项 +/// County item /// public readonly record struct CountyItem { /// - /// 城市编码 + /// 获得 城市编码 + /// Gets the city code /// public string Code { get; init; } /// - /// 城市名称 + /// 获得 城市名称 + /// Gets the city name /// public string Name { get; init; } } diff --git a/src/components/BootstrapBlazor.Region/Data/ProvinceItem.cs b/src/components/BootstrapBlazor.Region/Data/ProvinceItem.cs index 5ff522b1..0a214f4a 100644 --- a/src/components/BootstrapBlazor.Region/Data/ProvinceItem.cs +++ b/src/components/BootstrapBlazor.Region/Data/ProvinceItem.cs @@ -1,14 +1,30 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; +/// +/// 省份项 +/// Province item +/// readonly record struct ProvinceItem { + /// + /// 获得 名称 + /// Gets the name + /// public string Name { get; init; } + /// + /// 获得 拼音集合 + /// Gets the pinyin collection + /// public HashSet PinYin { get; init; } + /// + /// 获得 城市集合 + /// Gets the cities collection + /// public HashSet Cities { get; init; } } diff --git a/src/components/BootstrapBlazor.Region/Extensions/ServiceCollectionExtension.cs b/src/components/BootstrapBlazor.Region/Extensions/ServiceCollectionExtension.cs index 0a6ee55c..86664832 100644 --- a/src/components/BootstrapBlazor.Region/Extensions/ServiceCollectionExtension.cs +++ b/src/components/BootstrapBlazor.Region/Extensions/ServiceCollectionExtension.cs @@ -1,4 +1,4 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -7,15 +7,16 @@ namespace BootstrapBlazor.Components; /// -/// BootstrapBlazor service extensions +/// BootstrapBlazor 服务扩展 +/// BootstrapBlazor service extensions /// public static class ServiceCollectionExtension { /// - /// Inject service extension method. + /// 注入 服务扩展方法 + /// Injects service extension method /// /// - /// public static IServiceCollection AddBootstrapBlazorRegionService(this IServiceCollection services) { services.AddSingleton(); diff --git a/src/components/BootstrapBlazor.Region/Services/IRegionService.cs b/src/components/BootstrapBlazor.Region/Services/IRegionService.cs index 52fdae58..320ef449 100644 --- a/src/components/BootstrapBlazor.Region/Services/IRegionService.cs +++ b/src/components/BootstrapBlazor.Region/Services/IRegionService.cs @@ -1,38 +1,39 @@ -// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// IRegion 获得行政区域数据接口 +/// 获得行政区域数据接口 +/// Region data service interface /// public interface IRegionService { /// - /// 获得所有省份数据 + /// 获得所有省份数据 + /// Gets all province data /// - /// HashSet GetProvinces(); /// - /// 获得指定省份的城市数据 + /// 获得指定省份的城市数据 + /// Gets cities for the specified province /// /// - /// HashSet GetCities(string province); /// - /// 获得指定城市的区县数据 + /// 获得指定城市的区县数据 + /// Gets counties for the specified city /// /// - /// HashSet GetCounties(string city); /// - /// 获得指定区县的街道地址数据 + /// 获得指定区县的街道地址数据 + /// Gets detail addresses for the specified county /// /// - /// HashSet GetDetails(string countyCode); }