Skip to content

Commit b5d859c

Browse files
committed
Merge branch 'main' into alex/table/ScrollModeVirtual#5085
2 parents 4fe5c25 + d533904 commit b5d859c

File tree

17 files changed

+198
-11
lines changed

17 files changed

+198
-11
lines changed

src/BootstrapBlazor.Server/Components/Layout/ComponentLayout.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
108108
}
109109
if (Module != null)
110110
{
111-
await Module.InvokeVoidAsync("init");
111+
await Module.InvokeVoidAsync("scrollToAnchor");
112112
}
113113
}
114114

src/BootstrapBlazor.Server/Components/Layout/ComponentLayout.razor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function init() {
1+
export function scrollToAnchor() {
22
const hash = decodeURI(location.hash)
33
if (hash) {
44
const anchor = hash.split('-')[0]

src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
}
9999

100100
.main {
101-
height: 100%;
102101
width: calc(100% - var(--bb-sidebar-width));
103102
}
104103

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@page "/affix"
2+
3+
<h3>@Localizer["AffixTitle"]</h3>
4+
5+
<h4>@Localizer["AffixIntro"]</h4>
6+
7+
<DemoBlock Title="@Localizer["AffixNormalTitle"]" Introduction="@Localizer["AffixNormalIntro"]" Name="Normal">
8+
<div style="overflow: auto; height: 200px;">
9+
<div style="height: 50px;">标题栏 Header</div>
10+
<Affix>
11+
<div style="line-height: 50px;">固定行 Affix</div>
12+
</Affix>
13+
<div style="height: 300px;">
14+
<p>向下滚动查看效果</p>
15+
<div>Scroll down to see the affix effect</div>
16+
</div>
17+
</div>
18+
</DemoBlock>
19+
20+
<DemoBlock Title="@Localizer["AffixPositionTitle"]" Introduction="@Localizer["AffixPositionIntro"]" Name="Position">
21+
<div style="overflow: auto; height: 200px;">
22+
<div style="height: 50px;">标题栏 Header</div>
23+
<div style="height: 300px;">
24+
<p>上下滚动查看效果</p>
25+
<div>Scroll up and down to see the effect</div>
26+
</div>
27+
<Affix Position="AffixPosition.Bottom" Offset="10">
28+
<div>底部固定行 Affix</div>
29+
</Affix>
30+
</div>
31+
</DemoBlock>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
/// Affixs 组件
10+
/// </summary>
11+
public partial class Affixs
12+
{
13+
[Inject]
14+
[NotNull]
15+
private IStringLocalizer<Affixs>? Localizer { get; set; }
16+
}

src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ void AddForm(DemoMenuItem item)
316316
},
317317
new()
318318
{
319+
IsUpdate = true,
319320
Text = Localizer["Cascader"],
320321
Url = "cascader"
321322
},
@@ -404,6 +405,7 @@ void AddForm(DemoMenuItem item)
404405
},
405406
new()
406407
{
408+
IsUpdate = true,
407409
Text = Localizer["MultiSelect"],
408410
Url = "multi-select"
409411
},
@@ -429,22 +431,26 @@ void AddForm(DemoMenuItem item)
429431
},
430432
new()
431433
{
434+
IsUpdate = true,
432435
Match = NavLinkMatch.All,
433436
Text = Localizer["Select"],
434437
Url = "select"
435438
},
436439
new()
437440
{
441+
IsUpdate = true,
438442
Text = Localizer["SelectObject"],
439443
Url = "select-object"
440444
},
441445
new()
442446
{
447+
IsUpdate = true,
443448
Text = Localizer["SelectTable"],
444449
Url = "select-table"
445450
},
446451
new()
447452
{
453+
IsUpdate = true,
448454
Text = Localizer["SelectTree"],
449455
Url = "select-tree"
450456
},
@@ -502,6 +508,12 @@ void AddData(DemoMenuItem item)
502508
Url = "ajax"
503509
},
504510
new()
511+
{
512+
IsNew = true,
513+
Text = Localizer["Affix"],
514+
Url = "affix"
515+
},
516+
new()
505517
{
506518
Text = Localizer["Avatar"],
507519
Url = "avatar"
@@ -668,7 +680,6 @@ void AddData(DemoMenuItem item)
668680
},
669681
new()
670682
{
671-
IsNew = true,
672683
Text = Localizer["Player"],
673684
Url = "player"
674685
},
@@ -694,6 +705,7 @@ void AddData(DemoMenuItem item)
694705
},
695706
new()
696707
{
708+
IsNew = true,
697709
Text = Localizer["RDKit"],
698710
Url = "rdkit"
699711
},
@@ -709,6 +721,7 @@ void AddData(DemoMenuItem item)
709721
},
710722
new()
711723
{
724+
IsNew = true,
712725
Text = Localizer["SmilesDrawer"],
713726
Url = "smiles-drawer"
714727
},
@@ -945,6 +958,7 @@ void AddTable(DemoMenuItem item)
945958
},
946959
new()
947960
{
961+
IsUpdate = true,
948962
Text = Localizer["TableLookup"],
949963
Url = "table/lookup"
950964
},
@@ -1503,7 +1517,6 @@ void AddServices(DemoMenuItem item)
15031517
},
15041518
new()
15051519
{
1506-
IsNew = true,
15071520
Text = Localizer["WebSerial"],
15081521
Url = "web-serial"
15091522
},

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4786,7 +4786,8 @@
47864786
"WinBox": "WinBox",
47874787
"Player": "Player",
47884788
"RDKit": "RDKit",
4789-
"SmilesDrawer": "SmilesDrawer"
4789+
"SmilesDrawer": "SmilesDrawer",
4790+
"Affix": "Affix"
47904791
},
47914792
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
47924793
"TablesHeaderTitle": "Header grouping function",
@@ -6868,5 +6869,14 @@
68686869
"SmilesDrawerNormalIntro": "Set the molecular formula through <code>Smiles</code> and draw the component",
68696870
"SmilesDrawerSizeTitle": "Size",
68706871
"SmilesDrawerSizeIntro": "Set the width and height of the molecular formula by setting the <code>Width</code> and <code>Height</code> values"
6872+
},
6873+
"BootstrapBlazor.Server.Components.Samples.Affixs": {
6874+
"AffixTitle": "Affix",
6875+
"AffixIntro": "Fix the element to a specific visible area",
6876+
"AffixNormalTitle": "Basic usage",
6877+
"AffixNormalIntro": "Affix is fixed at the top of the page by default",
6878+
"AffixPositionTitle": "Position",
6879+
"AffixPositionIntro": "Use the parameter <code>Position</code> to control whether the top or bottom is fixed",
6880+
"AffixOffsetDesc": "The parameter <code>Position</code> controls whether the top or bottom is fixed, and the <code>Offset</code> value sets the offset to the top or bottom"
68716881
}
68726882
}

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4786,7 +4786,8 @@
47864786
"WinBox": "窗口 WinBox",
47874787
"Player": "播放器 Player",
47884788
"RDKit": "分子式组件 RDKit",
4789-
"SmilesDrawer": "分子式组件 SmilesDrawer"
4789+
"SmilesDrawer": "分子式组件 SmilesDrawer",
4790+
"Affix": "固钉组件 Affix"
47904791
},
47914792
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
47924793
"TablesHeaderTitle": "表头分组功能",
@@ -6868,5 +6869,13 @@
68686869
"SmilesDrawerNormalIntro": "通过 <code>Smiles</code> 设置分子式,组件画图",
68696870
"SmilesDrawerSizeTitle": "尺寸",
68706871
"SmilesDrawerSizeIntro": "通过设置 <code>Width</code> <code>Height</code> 值设置分子式宽高"
6872+
},
6873+
"BootstrapBlazor.Server.Components.Samples.Affixs": {
6874+
"AffixTitle": "Affix 固钉组件",
6875+
"AffixIntro": "将页面元素钉在可视范围",
6876+
"AffixNormalTitle": "基础用法",
6877+
"AffixNormalIntro": "固钉默认固定在页面顶部",
6878+
"AffixPositionTitle": "位置与距离",
6879+
"AffixPositionIntro": "通过参数 <code>Position</code> 控制固定顶端还是底端,通过 <code>Offset</code> 值设置到顶端或者底端距离偏移量"
68716880
}
68726881
}

src/BootstrapBlazor.Server/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@
222222
"win-box": "WinBoxes",
223223
"player": "Players",
224224
"rdkit": "Rdkits",
225-
"smiles-drawer": "SmilesDrawers"
225+
"smiles-drawer": "SmilesDrawers",
226+
"affix": "Affixs"
226227
},
227228
"video": {
228229
"table": "BV1ap4y1x7Qn?p=1",

src/BootstrapBlazor/BootstrapBlazor.csproj

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

33
<PropertyGroup>
44
<Version>9.2.7-beta05</Version>

0 commit comments

Comments
 (0)