-
-
Notifications
You must be signed in to change notification settings - Fork 7
doc(Region): update documentation #942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/components/BootstrapBlazor.Region/Components/SelectProvince.razor.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
|
|
||
| /// <summary> | ||
| /// SelectRegion 组件基类 | ||
| /// <para lang="zh">SelectRegion 组件基类</para> | ||
| /// <para lang="en">SelectRegion component base class</para> | ||
| /// </summary> | ||
| public abstract class SelectRegionBase : PopoverSelectBase<string> | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the placeholder text. | ||
| /// <para lang="zh">获得/设置 占位符文本</para> | ||
| /// <para lang="en">Gets or sets the placeholder text</para> | ||
| /// </summary> | ||
| [Parameter] | ||
| public string? PlaceHolder { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the color. The default is <see cref="Color.None"/> (no color). | ||
| /// <para lang="zh">获得/设置 颜色,默认为 <see cref="Color.None"/>(无颜色)</para> | ||
| /// <para lang="en">Gets or sets the color. The default is <see cref="Color.None"/> (no color)</para> | ||
| /// </summary> | ||
| [Parameter] | ||
| public Color Color { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the dropdown icon. The default is "fa-solid fa-angle-up". | ||
| /// <para lang="zh">获得/设置 下拉图标,默认为 fa-solid fa-angle-up</para> | ||
| /// <para lang="en">Gets or sets the dropdown icon. The default is "fa-solid fa-angle-up"</para> | ||
| /// </summary> | ||
| [Parameter] | ||
| [NotNull] | ||
| public string? DropdownIcon { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the callback method when the clear button is clicked. Default is null. | ||
| /// <para lang="zh">获得/设置 点击清空按钮时的回调方法,默认为 null</para> | ||
| /// <para lang="en">Gets or sets the callback method when the clear button is clicked. Default is null</para> | ||
| /// </summary> | ||
| [Parameter] | ||
| public Func<Task>? OnClearAsync { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the right-side clear icon. Default is fa-solid fa-angle-up. | ||
| /// <para lang="zh">获得/设置 右侧清空图标,默认为 fa-solid fa-angle-up</para> | ||
| /// <para lang="en">Gets or sets the right-side clear icon. Default is fa-solid fa-angle-up</para> | ||
| /// </summary> | ||
| [Parameter] | ||
| [NotNull] | ||
| public string? ClearIcon { get; set; } | ||
|
Comment on lines
42
to
48
|
||
|
|
||
| /// <summary> | ||
| /// Gets or sets the <see cref="IIconTheme"/> service instance. | ||
| /// <para lang="zh">获得/设置 <see cref="IIconTheme"/> 服务实例</para> | ||
| /// <para lang="en">Gets or sets the <see cref="IIconTheme"/> service instance</para> | ||
| /// </summary> | ||
| [Inject] | ||
| [NotNull] | ||
| protected IIconTheme? IconTheme { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// <see cref="IRegionService"/> service instance | ||
| /// <para lang="zh">获得/设置 <see cref="IRegionService"/> 服务实例</para> | ||
| /// <para lang="en">Gets or sets the <see cref="IRegionService"/> service instance</para> | ||
| /// </summary> | ||
| [Inject] | ||
| [NotNull] | ||
| protected IRegionService? RegionService { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 文本框样式 | ||
| /// <para lang="zh">获得 文本框样式</para> | ||
| /// <para lang="en">Gets the input box style</para> | ||
| /// </summary> | ||
| 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<string> | |
| .Build(); | ||
|
|
||
| /// <summary> | ||
| /// 下拉框按钮样式 | ||
| /// <para lang="zh">获得 下拉框按钮样式</para> | ||
| /// <para lang="en">Gets the dropdown button style</para> | ||
| /// </summary> | ||
| 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<string> | |
| .Build(); | ||
|
|
||
| /// <summary> | ||
| /// 清空按钮样式 | ||
| /// <para lang="zh">获得 清空按钮样式</para> | ||
| /// <para lang="en">Gets the clear button style</para> | ||
| /// </summary> | ||
| protected string? ClearClassString => CssBuilder.Default("clear-icon") | ||
| .AddClass($"text-{Color.ToDescriptionString()}", Color != Color.None) | ||
|
|
@@ -84,7 +95,8 @@ public abstract class SelectRegionBase : PopoverSelectBase<string> | |
| .Build(); | ||
|
|
||
| /// <summary> | ||
| /// 获得 选择框组件 Id | ||
| /// <para lang="zh">获得 选择框组件 Id</para> | ||
| /// <para lang="en">Gets the select component Id</para> | ||
| /// </summary> | ||
| protected string InputId => $"{Id}_input"; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">城市项</para> | ||
| /// <para lang="en">City item</para> | ||
| /// </summary> | ||
| readonly record struct CityItem | ||
| { | ||
| /// <summary> | ||
| /// <para lang="zh">获得 名称</para> | ||
| /// <para lang="en">Gets the name</para> | ||
| /// </summary> | ||
| public string Name { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">获得 拼音集合</para> | ||
| /// <para lang="en">Gets the pinyin collection</para> | ||
| /// </summary> | ||
| public HashSet<string> PinYin { get; init; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
|
|
||
| /// <summary> | ||
| /// Region 类 | ||
| /// <para lang="zh">区县项</para> | ||
| /// <para lang="en">County item</para> | ||
| /// </summary> | ||
| public readonly record struct CountyItem | ||
| { | ||
| /// <summary> | ||
| /// 城市编码 | ||
| /// <para lang="zh">获得 城市编码</para> | ||
| /// <para lang="en">Gets the city code</para> | ||
| /// </summary> | ||
| public string Code { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// 城市名称 | ||
| /// <para lang="zh">获得 城市名称</para> | ||
| /// <para lang="en">Gets the city name</para> | ||
ArgoZhang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /// </summary> | ||
| public string Name { get; init; } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">省份项</para> | ||
| /// <para lang="en">Province item</para> | ||
| /// </summary> | ||
| readonly record struct ProvinceItem | ||
| { | ||
| /// <summary> | ||
| /// <para lang="zh">获得 名称</para> | ||
| /// <para lang="en">Gets the name</para> | ||
| /// </summary> | ||
| public string Name { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">获得 拼音集合</para> | ||
| /// <para lang="en">Gets the pinyin collection</para> | ||
| /// </summary> | ||
| public HashSet<string> PinYin { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">获得 城市集合</para> | ||
| /// <para lang="en">Gets the cities collection</para> | ||
| /// </summary> | ||
| public HashSet<CityItem> Cities { get; init; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 11 additions & 10 deletions
21
src/components/BootstrapBlazor.Region/Services/IRegionService.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
|
|
||
| /// <summary> | ||
| /// IRegion 获得行政区域数据接口 | ||
| /// <para lang="zh">获得行政区域数据接口</para> | ||
| /// <para lang="en">Region data service interface</para> | ||
| /// </summary> | ||
| public interface IRegionService | ||
| { | ||
| /// <summary> | ||
| /// 获得所有省份数据 | ||
| /// <para lang="zh">获得所有省份数据</para> | ||
| /// <para lang="en">Gets all province data</para> | ||
| /// </summary> | ||
| /// <returns></returns> | ||
| HashSet<string> GetProvinces(); | ||
|
|
||
| /// <summary> | ||
| /// 获得指定省份的城市数据 | ||
| /// <para lang="zh">获得指定省份的城市数据</para> | ||
| /// <para lang="en">Gets cities for the specified province</para> | ||
| /// </summary> | ||
| /// <param name="province"></param> | ||
| /// <returns></returns> | ||
| HashSet<string> GetCities(string province); | ||
|
|
||
| /// <summary> | ||
| /// 获得指定城市的区县数据 | ||
| /// <para lang="zh">获得指定城市的区县数据</para> | ||
| /// <para lang="en">Gets counties for the specified city</para> | ||
| /// </summary> | ||
| /// <param name="city"></param> | ||
| /// <returns></returns> | ||
| HashSet<CountyItem> GetCounties(string city); | ||
|
|
||
| /// <summary> | ||
| /// 获得指定区县的街道地址数据 | ||
| /// <para lang="zh">获得指定区县的街道地址数据</para> | ||
| /// <para lang="en">Gets detail addresses for the specified county</para> | ||
| /// </summary> | ||
| /// <param name="countyCode"></param> | ||
| /// <returns></returns> | ||
| HashSet<string> GetDetails(string countyCode); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The XML docs claim the default DropdownIcon is the literal CSS class "fa-solid fa-angle-up", but the actual default is resolved at runtime via IconTheme.GetIconByKey(ComponentIcons.SelectDropdownIcon). Please update the docs to reflect the real default behavior (theme key-based), otherwise the documentation will be misleading when icon themes change.