Skip to content

Commit 68ebf1a

Browse files
committed
Merge branch 'main' into Feat_20250313
2 parents 9062da8 + 79fce04 commit 68ebf1a

34 files changed

+796
-370
lines changed

src/BootstrapBlazor.Server/Components/Pages/Introduction.razor

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
<h3>@Localizer["Title"]</h3>
55

6-
<p>@Localizer["P1"]</p>
7-
8-
<p>@Localizer["P2"]</p>
9-
10-
<p>@((MarkupString)Localizer["P3"].Value)</p>
6+
<p>@Localizer["SubTitle"]</p>
117

128
<h3>@Localizer["UpdateTitle"]</h3>
139

src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Introduction="@Localizer["TreeViewNormalIntro"]"
2828
Name="Normal">
2929
<section ignore>@((MarkupString)Localizer["TreeViewNormalDescription"].Value)</section>
30-
<TreeView Items="@NormalItems" OnTreeItemClick="@OnTreeItemClick" />
30+
<TreeView Items="@NormalItems" OnTreeItemClick="@OnTreeItemClick" ShowToolbar="true"></TreeView>
3131
<ConsoleLogger @ref="Logger1" />
3232
</DemoBlock>
3333

@@ -203,6 +203,16 @@
203203
</div>
204204
</DemoBlock>
205205

206+
<DemoBlock Title="@Localizer["TreeViewShowToolbarTitle"]"
207+
Introduction="@Localizer["TreeViewShowToolbarIntro"]"
208+
Name="ShowToolbar">
209+
<section ignore>
210+
<p>@((MarkupString)Localizer["TreeViewShowToolbarDesc"].Value)</p>
211+
</section>
212+
<TreeView Items="@EditItems" ShowToolbar="true" OnUpdateCallbackAsync="OnUpdateCallbackAsync">
213+
</TreeView>
214+
</DemoBlock>
215+
206216
<AttributeTable Items="@GetAttributes()"></AttributeTable>
207217

208218
<AttributeTable Items="@GetTreeItemAttributes()" Title="@Localizer["TreeViewsAttribute"]"></AttributeTable>

src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public sealed partial class TreeViews
3030

3131
private List<TreeViewItem<TreeFoo>> Items { get; } = TreeFoo.GetTreeItems();
3232

33+
private List<TreeViewItem<TreeFoo>> EditItems { get; } = TreeFoo.GetTreeItems();
34+
3335
private bool AutoCheckChildren { get; set; }
3436

3537
private bool AutoCheckParent { get; set; }
@@ -218,6 +220,12 @@ private static async Task<IEnumerable<TreeViewItem<TreeFoo>>> OnExpandVirtualNod
218220
return items;
219221
}
220222

223+
private Task<bool> OnUpdateCallbackAsync(TreeFoo foo, string? text)
224+
{
225+
foo.Text = text;
226+
return Task.FromResult(true);
227+
}
228+
221229
/// <summary>
222230
/// 获得属性方法
223231
/// </summary>

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,10 @@
711711
"TreeViewEnableKeyboardArrowUpDownIntro": "Support keyboard up and down arrow operations by setting <code>EnableKeyboardArrowUpDown=\"true\"</code>. <kbd>ArrowLeft</kbd> collapse the node, <kbd>ArrowRight</kbd> expand the node, <kbd>ArrowUp</kbd> move the node up, <kbd>ArrowDown</kbd> move the node down, <kbd>Space</kbd> select the node,",
712712
"TreeViewVirtualizeTitle": "Virtualize",
713713
"TreeViewVirtualizeIntro": "Enable virtual scrolling by setting <code>IsVirtualize=\"true\"</code> to support big data",
714-
"TreeViewVirtualizeDescription": "The component uses <code>Virtualize</code> to implement virtual scrolling logic, which reduces the pressure on the browser. However, if there is a lot of tree structure data, such as <b>Select All</b>, all data must be marked, resulting in large data in the memory. This problem has not been solved yet. Currently, this component still puts a lot of pressure on the <b>CPU</b> due to large data."
714+
"TreeViewVirtualizeDescription": "The component uses <code>Virtualize</code> to implement virtual scrolling logic, which reduces the pressure on the browser. However, if there is a lot of tree structure data, such as <b>Select All</b>, all data must be marked, resulting in large data in the memory. This problem has not been solved yet. Currently, this component still puts a lot of pressure on the <b>CPU</b> due to large data.",
715+
"TreeViewShowToolbarTitle": "Show Toolbar",
716+
"TreeViewShowToolbarIntro": "Show the toolbar by setting <code>ShowToolbar=\"true\"</code>",
717+
"TreeViewShowToolbarDesc": "After it is turned on, when the mouse hovers over a node, a toolbar icon appears on the right, and the toolbar function can be customized; data is updated by setting the <code>OnUpdateCallbackAsync</code> callback method; the toolbar template is defined by setting <code>ToolbarTemplate</code>, and if not set, the internal default node name template is used"
715718
},
716719
"BootstrapBlazor.Server.Components.Samples.SwitchButtons": {
717720
"SwitchButtonsTitle": "Switch Button state switch button",
@@ -5747,11 +5750,9 @@
57475750
},
57485751
"BootstrapBlazor.Server.Components.Pages.Introduction": {
57495752
"Title": "Introduction",
5750-
"P1": "BootstrapBlazor is an enterprise-level component library based on Bootstrap and Blazor, which can be considered as the Blazor version of the Bootstrap project.",
5751-
"P2": "The dependency is:BootstrapBlazor > Bootstrap",
5752-
"P3": "In the latest <a href='template' target='_blank'>Project Template</a> ,the above dependencies are packaged and bundled, which greatly simplifies use",
5753+
"SubTitle": "BootstrapBlazor is an enterprise-level component library based on Bootstrap and Blazor, which can be considered as the Blazor version of the Bootstrap project.",
57535754
"UpdateTitle": "Update Log",
5754-
"UpdateLog": "In order to fix the components <b><code>bugs</code></b>, a small version of the component may be released every day. The second <b><code>Thursday</code></b> every month release <b><code>official version</code></b>",
5755+
"UpdateLog": "In order to fix the components <b><code>bugs</code></b>, a small version of the component may be released every day.",
57555756
"UpdateLogLink": "[Update Log]",
57565757
"LearnTitle": "Learning materials",
57575758
"LearnLi1": "Blazor Official Document",
@@ -5770,7 +5771,7 @@
57705771
"GetStarted": "Get Started",
57715772
"QuickStart": "Quick Start",
57725773
"Features": "Features of Components",
5773-
"P6": "The Bootstrap Blazor UI component library provides everything from basic <code>Button</code> components to advanced web-level <code>SmartPage</code> components",
5774+
"P6": "The Bootstrap Blazor UI component library provides everything from basic <code>Button</code> components to advanced web-level <code>Online</code> components",
57745775
"Advantage": "Advantage",
57755776
"AdvantageLi1": "No need to write <code>JavaScript</code> to use components",
57765777
"AdvantageLi2": "The component supports all <code>html</code> features",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,10 @@
711711
"TreeViewEnableKeyboardArrowUpDownIntro": "通过设置 <code>EnableKeyboardArrowUpDown=\"true\"</code> 支持键盘上下箭头操作。<kbd>左箭头</kbd> 收起节点,<kbd>右箭头</kbd> 展开节点,<kbd>上箭头</kbd> 向上移动节点,<kbd>下箭头</kbd> 向下移动节点,<kbd>空格</kbd> 选中节点",
712712
"TreeViewVirtualizeTitle": "虚拟滚动",
713713
"TreeViewVirtualizeIntro": "通过设置 <code>IsVirtualize=\"true\"</code> 开启虚拟滚动,支持大数据",
714-
"TreeViewVirtualizeDescription": "组件内部使用 <code>Virtualize</code> 来实现虚拟滚动逻辑,对浏览器压力会减少很多;但是如果树状结构数据比较多,比如 <b>全选</b> 等操作必须对所有数据进行标记,导致内存中确实有大数据存在,目前还没有解决这个问题,目前此组件由于大数据对 <b>CPU</b> 压力还是比较大的"
714+
"TreeViewVirtualizeDescription": "组件内部使用 <code>Virtualize</code> 来实现虚拟滚动逻辑,对浏览器压力会减少很多;但是如果树状结构数据比较多,比如 <b>全选</b> 等操作必须对所有数据进行标记,导致内存中确实有大数据存在,目前还没有解决这个问题,目前此组件由于大数据对 <b>CPU</b> 压力还是比较大的",
715+
"TreeViewShowToolbarTitle": "显示工具栏",
716+
"TreeViewShowToolbarIntro": "通过设置 <code>ShowToolbar=\"true\"</code> 显示工具栏",
717+
"TreeViewShowToolbarDesc": "开启后鼠标悬浮节点时,右侧出现工具栏图标,可自定义工具栏功能;通过设置 <code>OnUpdateCallbackAsync</code> 回调方法进行数据的更新;通过设置 <code>ToolbarTemplate</code> 定义工具栏模板,如未设置时使用内部默认更改节点名称模板"
715718
},
716719
"BootstrapBlazor.Server.Components.Samples.SwitchButtons": {
717720
"SwitchButtonsTitle": "Switch Button 状态切换按钮",
@@ -5747,11 +5750,9 @@
57475750
},
57485751
"BootstrapBlazor.Server.Components.Pages.Introduction": {
57495752
"Title": "简介",
5750-
"P1": "BootstrapBlazor 是一套基于 Bootstrap 和 Blazor 的企业级组件库,可以认为是 Bootstrap 项目的 Blazor 版实现。",
5751-
"P2": "依赖关系为:BootstrapBlazor > Bootstrap",
5752-
"P3": "最新 <a href='template' target='_blank'>项目模板</a> 中将以上依赖进行了打包捆绑大大简化使用",
5753+
"SubTitle": "BootstrapBlazor 是一套基于 Bootstrap 和 Blazor 的企业级组件库,可以认为是 Bootstrap 项目的 Blazor 版实现。",
57535754
"UpdateTitle": "更新日志",
5754-
"UpdateLog": "为了修复组件 <code>bug</code> 每天可能有小版本发布,每个月第二个 <b><code>周四</code></b> 发布 <b><code>正式版</code></b> 更新日志",
5755+
"UpdateLog": "为了修复组件 <code>bug</code> 每天可能有小版本发布更新日志",
57555756
"UpdateLogLink": "[传送门]",
57565757
"LearnTitle": "学习资料",
57575758
"LearnLi1": "Blazor 官方文档",
@@ -5770,7 +5771,7 @@
57705771
"GetStarted": "快速上手",
57715772
"QuickStart": "快速入门",
57725773
"Features": "组件特色",
5773-
"P6": "Bootstrap Blazor UI 组件库提供了从基本的 <code>Button</code> 组件到高级的网页级 <code>SmartPage</code> 组件",
5774+
"P6": "Bootstrap Blazor UI 组件库提供了从基本的 <code>Button</code> 组件到高级的网页级 <code>Online</code> 组件",
57745775
"Advantage": "优势",
57755776
"AdvantageLi1": "使用组件无需编写 <code>JavaScript</code>",
57765777
"AdvantageLi2": "组件支持所有 <code>html</code> 特性",

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.4.9-beta03</Version>
4+
<Version>9.4.9-beta06</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Button/PopConfirmButton.razor.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ export function init(id) {
3131
confirm.inserted = () => {
3232
const popover = getDescribedElement(el)
3333
const children = confirm.container.children
34-
const len = children.length
35-
for (let i = 0; i < len; i++) {
36-
popover.appendChild(children[i])
34+
while (children.length > 0) {
35+
popover.appendChild(children[0])
3736
}
3837
}
3938
confirm.hide = () => {

src/BootstrapBlazor/Components/Dialog/Dialog.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public partial class Dialog : IDisposable
2727
private Dictionary<string, object>? _currentParameter;
2828
private bool _isKeyboard = false;
2929
private bool _isBackdrop = false;
30-
private bool _isFade = true;
30+
private bool? _isFade = null;
3131

3232
/// <summary>
3333
/// <inheritdoc/>

src/BootstrapBlazor/Components/Dialog/DialogOption.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public class DialogOption
6868
public bool ShowHeaderCloseButton { get; set; } = true;
6969

7070
/// <summary>
71-
/// Gets or sets whether to enable fade animation, default is true
71+
/// Gets or sets whether to enable fade animation, default is null
7272
/// </summary>
73-
public bool IsFade { get; set; } = true;
73+
public bool? IsFade { get; set; }
7474

7575
/// <summary>
7676
/// Gets or sets whether to support closing the dialog with the ESC key, default is true

src/BootstrapBlazor/Components/Input/BootstrapInput.razor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export function handleKeyUp(id, invoke, enter, enterCallbackMethod, esc, escCall
1212
if (el) {
1313
EventHandler.on(el, 'keyup', e => {
1414
if (enter && (e.key === 'Enter' || e.key === 'NumpadEnter')) {
15+
const useShiftEnter = el.getAttribute('data-bb-shift-enter') === 'true';
16+
if (!e.shiftKey && useShiftEnter) {
17+
return;
18+
}
1519
invoke.invokeMethodAsync(enterCallbackMethod, el.value)
1620
}
1721
else if (esc && e.key === 'Escape') {

0 commit comments

Comments
 (0)