Skip to content

Commit 9578758

Browse files
authored
feat(RDKit): add RDKit component (#5058)
* doc: 增加示例 * doc: 增加菜单 * doc: 增加源代码映射 * doc: 增加本地化 * chore: 增加 RDKit 包 * doc: 代码格式化
1 parent 41a0230 commit 9578758

File tree

8 files changed

+60
-8
lines changed

8 files changed

+60
-8
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="9.0.1" />
5454
<PackageReference Include="BootstrapBlazor.PdfReader" Version="9.0.0" />
5555
<PackageReference Include="BootstrapBlazor.Player" Version="9.0.0" />
56+
<PackageReference Include="BootstrapBlazor.RDKit" Version="9.0.0-beta01" />
5657
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="9.0.0" />
5758
<PackageReference Include="BootstrapBlazor.Sortable" Version="9.0.1" />
5859
<PackageReference Include="BootstrapBlazor.Splitting" Version="9.0.1" />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@page "/rdkit"
2+
@inject IStringLocalizer<RDKits> Localizer
3+
4+
<h3>@Localizer["RDKitTitle"]</h3>
5+
6+
<h4>@Localizer["RDKitDescription"]</h4>
7+
8+
<PackageTips Name="BootstrapBlazor.RDKit" />
9+
10+
<DemoBlock Title="@Localizer["RDKitNormalTitle"]"
11+
Introduction="@Localizer["RDKitNormalIntro"]"
12+
Name="Normal">
13+
<RDKit Value="CC(=O)Oc1ccccc1C(=O)O"></RDKit>
14+
</DemoBlock>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
5+
6+
namespace BootstrapBlazor.Server.Components.Samples;
7+
8+
/// <summary>
9+
/// RDKits 组件
10+
/// </summary>
11+
public partial class RDKits
12+
{
13+
14+
}

src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,11 @@ void AddData(DemoMenuItem item)
693693
Url = "repeater"
694694
},
695695
new()
696+
{
697+
Text = Localizer["RDKit"],
698+
Url = "rdkit"
699+
},
700+
new()
696701
{
697702
Text = Localizer["Search"],
698703
Url = "search"

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4778,7 +4778,8 @@
47784778
"DrawerService": "DrawerService",
47794779
"SortableList": "SortableList",
47804780
"WinBox": "WinBox",
4781-
"Player": "Player"
4781+
"Player": "Player",
4782+
"RDKit": "RDKit"
47824783
},
47834784
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
47844785
"TablesHeaderTitle": "Header grouping function",
@@ -6837,5 +6838,11 @@
68376838
"AttributeSrc": "Frame load url",
68386839
"AttributeData": "Data passed",
68396840
"AttributeOnPostDataAsync": "Passed back data"
6841+
},
6842+
"BootstrapBlazor.Server.Components.Samples.RDKits": {
6843+
"RDKitTitle": "RDKit",
6844+
"RDKitDescription": "A powerful cheminformatics and molecule rendering toolbelt for Blazor, Powered by RDKit",
6845+
"RDKitNormalTitle": "Basic usage",
6846+
"RDKitNormalIntro": "Set the molecular formula through <code>Value</code> and draw the component"
68406847
}
68416848
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4778,7 +4778,8 @@
47784778
"DrawerService": "抽屉服务 DrawerService",
47794779
"SortableList": "拖拽组件 SortableList",
47804780
"WinBox": "窗口 WinBox",
4781-
"Player": "播放器 Player"
4781+
"Player": "播放器 Player",
4782+
"RDKit": "分子图组件 RDKit"
47824783
},
47834784
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
47844785
"TablesHeaderTitle": "表头分组功能",
@@ -6837,5 +6838,11 @@
68376838
"AttributeSrc": "Frame 加载网页路径",
68386839
"AttributeData": "传递的数据",
68396840
"AttributeOnPostDataAsync": "Frame 加载页面传递过来的数据"
6841+
},
6842+
"BootstrapBlazor.Server.Components.Samples.RDKits": {
6843+
"RDKitTitle": "分子图组件",
6844+
"RDKitDescription": "RDKit 是一个开源的化学信息学工具包,用于分子建模和化学信息学",
6845+
"RDKitNormalTitle": "基础用法",
6846+
"RDKitNormalIntro": "通过 <code>Value</code> 设置分子式,组件画图"
68406847
}
68416848
}

src/BootstrapBlazor.Server/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@
220220
"barcode-generator": "BarcodeGenerators",
221221
"sortable-list": "SortableLists",
222222
"win-box": "WinBoxes",
223-
"player": "Players"
223+
"player": "Players",
224+
"rdkit": "Rdkits"
224225
},
225226
"video": {
226227
"table": "BV1ap4y1x7Qn?p=1",

src/BootstrapBlazor/Components/Table/Table.razor.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,21 +416,24 @@ const setExcelKeyboardListener = table => {
416416
break;
417417
}
418418
}
419-
} else if (keyCode === KeyCodes.RIGHT_ARROW) {
419+
}
420+
else if (keyCode === KeyCodes.RIGHT_ARROW) {
420421
while (++index < cells.length) {
421422
if (activeCell(cells, index)) {
422423
break;
423424
}
424425
}
425-
} else if (keyCode === KeyCodes.UP_ARROW) {
426-
cells = tr.previousElementSibling.children;
426+
}
427+
else if (keyCode === KeyCodes.UP_ARROW) {
428+
cells = tr.previousElementSibling?.children;
427429
while (index < cells.length) {
428430
if (activeCell(cells, index)) {
429431
break;
430432
}
431433
}
432-
} else if (keyCode === KeyCodes.DOWN_ARROW) {
433-
cells = tr.nextElementSibling.children;
434+
}
435+
else if (keyCode === KeyCodes.DOWN_ARROW) {
436+
cells = tr.nextElementSibling?.children;
434437
while (index < cells.length) {
435438
if (activeCell(cells, index)) {
436439
break;

0 commit comments

Comments
 (0)