diff --git a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor index bf3260a1fa1..c3c3df2fce3 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor @@ -9,7 +9,9 @@
@((MarkupString)Localizer["NormalDesc"].Value)
- + @@ -46,7 +48,7 @@
@context.Id
@context.Name
- +
@@ -112,4 +114,32 @@
+ +
+
    +
  • @((MarkupString)Localizer["IsMultipleDesc1"].Value)
  • +
  • @((MarkupString)Localizer["IsMultipleDesc2"].Value)
  • +
  • @((MarkupString)Localizer["IsMultipleDesc3"].Value)
  • +
  • @((MarkupString)Localizer["IsMultipleDesc4"].Value)
  • +
  • @((MarkupString)Localizer["IsMultipleDesc5"].Value)
  • +
+
+ + + + + + +
+
+ @foreach (var item in _selectedFoos) + { +
@item.Name
+ } +
+
+
+ diff --git a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs index 8b3199e0271..ccfb36772e7 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs @@ -34,6 +34,8 @@ public partial class SelectTables private readonly SelectTableMode Model = new(); + private List _selectedFoos = []; + private static string? GetTextCallback(Foo foo) => foo.Name; private List _items = default!; diff --git a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.css b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.css index 448fc071fc9..a75a56a2abd 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.css +++ b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.css @@ -1,4 +1,4 @@ -::deep .divider { +::deep .divider { --bb-divider-margin: 1rem 0; --bb-divider-bg: #c0c4cc; } @@ -54,3 +54,11 @@ ::deep .select-custom-detail > div { margin-bottom: .5rem; } + +.select-table-list { + display: flex; + flex-wrap: wrap; + gap: 5px; + overflow: auto; + max-height: 120px; +} diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index fdcdc59e371..56ac19e19e7 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -2053,7 +2053,7 @@ "DropdownCascadeItem6": "Haidian", "DropdownCascadeItem7": "Jingan", "DropdownCascadeItem8": "Huangpu", - "DropdownItemsTemplateIntro": "You can customize all the content of the dropdown list by setting ``. In this example, we use the `` component and `` component to customize the dropdown list component.", + "DropdownItemsTemplateIntro": "You can customize all the content of the dropdown list by setting ItemsTemplate. In this example, we use the DropdownItem component and DropdownDivider component to customize the dropdown list component.", "DropdownItemsTemplateTitle": "Items Template", "DropdownItemTemplateIntro": "By setting ItemTemplate, you can customize the content displayed in the drop-down item. In this example, the Tooltip component is used to add a tooltip function when the mouse is hovered.", "DropdownItemTemplateTitle": "Item Template", @@ -2766,13 +2766,13 @@ "LabelsNormalDescription": "When two-way binding is not used", "LabelsNormalDescription2": "When using two-way binding", "LabelsNormalGroupBox1Tips1": "No settings in the first text box, no label", - "LabelsNormalGroupBox1Tips2": "The second text box setting ShowLabel='true' DisplayText=`` displays a placeholder label without content", + "LabelsNormalGroupBox1Tips2": "The second text box setting ShowLabel='true' DisplayText='' displays a placeholder label without content", "LabelsNormalGroupBox1Tips3": "The third text box setting ShowLabel='true' DisplayText='Name' shows the set content label", "LabelsNormalGroupBox1Tips4": "The fourth text box setting ShowLabel='true' DisplayText='@null' displays a placeholder label without content", "LabelsNormalGroupBox1Title": "No two-way binding", "LabelsNormalGroupBox2Tips1": "The first text box is set to @bind-Value='Dummy.Name', no label is displayed", "LabelsNormalGroupBox2Tips2": "The second text box setting @bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@Localizer[nameof(Foo.Address)]' Display the contents of the setting", - "LabelsNormalGroupBox2Tips3": "The third text box setting @bind-Value='Dummy.Name' ShowLabel='true' DisplayText=`` Show no content placeholder label", + "LabelsNormalGroupBox2Tips3": "The third text box setting @bind-Value='Dummy.Name' ShowLabel='true' DisplayText='' Show no content placeholder label", "LabelsNormalGroupBox2Tips4": "The fourth text box setting @bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@null' Display the label content under the resource file mechanismLabel code>", "LabelsNormalGroupBox2Title": "Two-way binding", "LabelsNormalIntro": "Suitable for data entry", @@ -3937,6 +3937,13 @@ "Intro": "The dropdown box is a table used to display the selection requirements for complex types", "IsDisabledIntro": "When you set the IsDisabled property value to true, the component suppresses select", "IsDisabledTitle": "Disabled", + "IsMultipleDesc1": "Set the maximum width of the selected item using the MultiSelectedItemMaxWidth parameter.", + "IsMultipleDesc2": "Set the maximum row height of the component using the MultiSelectedItemsMaxHeight parameter.", + "IsMultipleDesc3": "The MultiSelectedItemsMaxDisplayCount parameter sets the total number of selected items to be displayed. To customize the color, please set the variable --bb-select-table-item-count-bg-color in your CSS.", + "IsMultipleDesc4": "The MultiSelectedItemsMaxDisplayCountColor parameter sets the color of total number of selected items to be displayed.", + "IsMultipleDesc5": "Set the selected item set using the @bind-SelectedItems=\"SelectedItems\" parameter. Do not use Value in multi-select mode.", + "IsMultipleSelectIntro": "Enable multi-selection using the parameter IsMultipleSelect=\"true\".", + "IsMultipleSelectTitle": "Multiple Select", "NormalDesc": "You can use IsClearable to control whether to display the clear button. The default value is false", "NormalIntro": "Suitable for candidates with a relatively large amount of information, presenting information using Table", "NormalTitle": "Basic usage", @@ -4121,7 +4128,7 @@ "SpeechDescription2": "When using this component, you need to reference its component package", "SpeechGroupBoxHeaderText": "command panel", "SpeechGroupBoxTitle": "Command output area", - "SpeechLi1": "Click start After pressing the button, speak to the computer 'Please turn on the light for me'", + "SpeechLi1": "Click start After pressing the button, speak to the computer Please turn on the light for me", "SpeechLi2": "After the computer receives the command, it will ask Are you sure you want to turn on the light? Please confirm!", "SpeechLi3": "You speak to the computer: confirm", "SpeechLi4": "The computer executes the command and enters it in the text box below has been opened for you text", @@ -5670,7 +5677,7 @@ "BootstrapBlazor.Server.Components.Samples.UploadCards": { "ButtonUploadIntro": "Use DefaultFileList to set up uploaded content", "ButtonUploadTitle": "Basic usage", - "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `ActionButtonTemplate` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `BeforeActionButtonTemplate` parameter (insert it before the default button).", + "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the ActionButtonTemplate parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the BeforeActionButtonTemplate parameter (insert it before the default button).", "UploadActionButtonTemplateTitle": "Custom action button", "UploadBase64Intro": "By setting the PrevUrl parameter value of the UploadFile instance, use the image content string in the data:image/xxx;base64,XXXXX format as the preview file path", "UploadBase64Title": "Base64 format", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index cc472b215bf..cb132bade5e 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -3937,6 +3937,13 @@ "Intro": "下拉框为表格用于展示复杂类型的选择需求", "IsDisabledIntro": "设置 IsDisabled 属性值为 true 时,组件禁止选择", "IsDisabledTitle": "禁用", + "IsMultipleDesc1": "通过 MultiSelectedItemMaxWidth 参数设置选中项最大宽度", + "IsMultipleDesc2": "通过 MultiSelectedItemsMaxHeight 参数设置组件最大行高", + "IsMultipleDesc3": "通过 MultiSelectedItemsMaxDisplayCount 参数设置选中项显示总数量", + "IsMultipleDesc4": "通过 MultiSelectedItemsMaxDisplayCountColor 参数设置选中项显示总数量标签颜色,如需自定义颜色请设置 css 变量 --bb-select-table-item-count-bg-color", + "IsMultipleDesc5": "通过 @bind-SelectedItems=\"SelectedItems\" 参数设置选中项集合,多选模式下不要使用 Value", + "IsMultipleSelectIntro": "通过 IsMultipleSelect=\"true\" 参数开启多选", + "IsMultipleSelectTitle": "多选", "NormalDesc": "可通过 IsClearable 控制是否显示清除小按钮,默认值 false", "NormalIntro": "适用于候选项信息量比较大,用 Table 呈现信息量", "NormalTitle": "基本功能", diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 81d8957de88..5f06f943ea2 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 10.3.1 + 10.3.2-beta01 diff --git a/src/BootstrapBlazor/Components/Select/Select.razor.scss b/src/BootstrapBlazor/Components/Select/Select.razor.scss index 50f794df5bf..d0fc99a2117 100644 --- a/src/BootstrapBlazor/Components/Select/Select.razor.scss +++ b/src/BootstrapBlazor/Components/Select/Select.razor.scss @@ -1,4 +1,4 @@ -@use "../../wwwroot/scss/variables" as *; +@use "../../wwwroot/scss/variables" as *; .select, .popover-dropdown { @@ -11,6 +11,7 @@ --bb-select-padding: #{$bb-select-padding}; --bb-select-append-width: #{$bb-select-append-width}; --bb-select-append-color: #{$bb-select-append-color}; + --bb-select-append-right: 0; } .select:not(.cascade) .dropdown-menu { @@ -105,7 +106,7 @@ position: absolute; height: 100%; width: var(--bb-select-append-width); - right: 0; + right: var(--bb-select-append-right); top: 0; color: var(--bb-select-append-color); pointer-events: none; @@ -129,7 +130,7 @@ position: absolute; height: 100%; width: var(--bb-select-append-width); - right: 0; + right: var(--bb-select-append-right); top: 0; color: var(--bb-select-append-color); align-items: center; diff --git a/src/BootstrapBlazor/Components/Select/SelectTable.razor b/src/BootstrapBlazor/Components/Select/SelectTable.razor index 6183da0a84c..2030f8ac355 100644 --- a/src/BootstrapBlazor/Components/Select/SelectTable.razor +++ b/src/BootstrapBlazor/Components/Select/SelectTable.razor @@ -1,4 +1,4 @@ -@namespace BootstrapBlazor.Components +@namespace BootstrapBlazor.Components @typeparam TItem @inherits PopoverDropdownBase @attribute [BootstrapModuleAutoLoader("Select/SelectTable.razor.js", JSObjectReference = true)] @@ -7,11 +7,43 @@ { } -
-