diff --git a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj index f7a080fcc5d..e9e63920393 100644 --- a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj +++ b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj @@ -66,7 +66,7 @@ - + diff --git a/src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor b/src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor new file mode 100644 index 00000000000..41eac9c4e62 --- /dev/null +++ b/src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor @@ -0,0 +1,20 @@ +@page "/select-city" +@inject IStringLocalizer Localizer + +

@Localizer["CityTitle"]

+ +

@Localizer["CityDescription"]

+ + + + + + + + + + diff --git a/src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor.cs new file mode 100644 index 00000000000..a371265382a --- /dev/null +++ b/src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the Apache 2.0 License +// See the LICENSE file in the project root for more information. +// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone + +namespace BootstrapBlazor.Server.Components.Samples; + +/// +/// 城市选择器示例 +/// +public partial class SelectCities +{ + private string? _value = null; + + private string? _multipleValues = null; +} diff --git a/src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs b/src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs index 9b7ae0463d2..fcb845b58f3 100644 --- a/src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs +++ b/src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone -using Longbow.SerialPorts; using Microsoft.AspNetCore.Components.Routing; namespace BootstrapBlazor.Server.Extensions; @@ -451,12 +450,6 @@ void AddForm(DemoMenuItem item) Url = "floating-label" }, new() - { - IsNew = true, - Text = Localizer["SelectRegion"], - Url = "select-region" - }, - new() { Text = Localizer["ListGroup"], Url = "list-group" @@ -529,6 +522,18 @@ void AddForm(DemoMenuItem item) Url = "select" }, new() + { + IsNew = true, + Text = Localizer["SelectCity"], + Url = "select-city" + }, + new() + { + IsNew = true, + Text = Localizer["SelectRegion"], + Url = "select-region" + }, + new() { Text = Localizer["SelectObject"], Url = "select-object" diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 3838dc67e85..34d2621afa2 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -4873,7 +4873,8 @@ "Navbar": "Navbar", "TaskDashBoard": "TaskDashBoard", "Dom2ImageService": "IDom2HtmlService", - "SelectRegion": "Region Selector" + "SelectRegion": "Region Selector", + "SelectCity": "City Selector" }, "BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": { "TablesHeaderTitle": "Header grouping function", @@ -7227,5 +7228,13 @@ "RegionDescription": "A simple region cascade selector, provide 4 levels Chinese administrative division data", "RegionNormalTitle": "Basic usage", "RegionNormalIntro": "Use grouping to switch the selection mode for displaying administrative areas" + }, + "BootstrapBlazor.Server.Components.Samples.SelectCities": { + "CityTitle": "City Selector", + "CityDescription": "Provides a city selector classified by province", + "CityNormalTitle": "Basic usage", + "CityNormalIntro": "Select a city from the drop-down box", + "CityMultipleTitle": "Multiple", + "CityMultipleIntro": "Enable multiple selection mode by setting IsMultiple , and all cities will be automatically selected when clicking a province in the pop-up window." } } diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 7e8dba90dae..4e8fc77eb52 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -4873,7 +4873,8 @@ "Navbar": "导航栏 Navbar", "TaskDashBoard": "任务管理器 TaskDashBoard", "Dom2ImageService": "节点转图片服务 IDom2HtmlService", - "SelectRegion": "行政区域选择器 SelectRegion" + "SelectRegion": "行政区域选择器 SelectRegion", + "SelectCity": "城市选择器 SelectCity" }, "BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": { "TablesHeaderTitle": "表头分组功能", @@ -7223,9 +7224,17 @@ "Dom2ImageFullText": "长截图" }, "BootstrapBlazor.Server.Components.Samples.SelectRegions": { - "RegionTitle": "Region 行政区域选择器", + "RegionTitle": "SelectRegion 行政区域选择器", "RegionDescription": "提供 4 级行政区划选择器", "RegionNormalTitle": "基本用法", "RegionNormalIntro": "使用分组切换显示行政区域的选择模式" + }, + "BootstrapBlazor.Server.Components.Samples.SelectCities": { + "CityTitle": "SelectCity 城市选择器", + "CityDescription": "提供以省分类的城市选择器", + "CityNormalTitle": "基本用法", + "CityNormalIntro": "通过下拉框的形式选择城市", + "CityMultipleTitle": "多选", + "CityMultipleIntro": "通过设置 IsMultiple 开启多选模式,点击弹窗中省份时自动选中所有城市" } } diff --git a/src/BootstrapBlazor.Server/docs.json b/src/BootstrapBlazor.Server/docs.json index a3e2032af2f..3953216e7e4 100644 --- a/src/BootstrapBlazor.Server/docs.json +++ b/src/BootstrapBlazor.Server/docs.json @@ -256,7 +256,8 @@ "task-board": "TaskBoard", "modbus-factory": "Modbus\\ModbusFactories", "serial-port-factory": "SerialPorts\\SerialPortFactories", - "select-region": "Regions" + "select-region": "SelectRegions", + "select-city": "SelectCities" }, "video": { "table": "BV1ap4y1x7Qn?p=1",