Skip to content

Commit 52bbcf6

Browse files
committed
2 parents 3bde9c8 + 22e67cf commit 52bbcf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+663
-113
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@
66

77
<section class="bd-masthead">
88
<div class="container-xxl bd-gutter">
9-
<div class="col-md-8 mx-auto text-center">
10-
<a class="d-flex flex-column flex-lg-row justify-content-center align-items-center mb-4 text-dark lh-sm text-decoration-none" href="https://github.com/dotnetcore/BootstrapBlazor?wt.mc_id=DT-MVP-5004174" rel="noopener" target="_blank">
11-
<span class="d-sm-inline-flex align-items-center gap-1 py-2 px-3 mb-lg-0 rounded-5 masthead-notice">
9+
<div class="text-center d-flex align-items-center flex-column">
10+
<a class="d-inline-flex text-dark text-decoration-none" href="https://github.com/dotnetcore/BootstrapBlazor?wt.mc_id=DT-MVP-5004174" rel="noopener" target="_blank">
11+
<span class="py-2 px-3 rounded-5 masthead-notice">
1212
@Localizer["Support"]
1313
</span>
1414
</a>
15-
<img src="./favicon.png" alt="bootstrap-blazor" class="bb-logo d-none d-sm-block mx-auto my-5">
15+
<img src="./favicon.png" alt="bootstrap-blazor" class="bb-logo d-sm-block mx-auto my-5">
1616
<h1 class="mb-3 fw-semibold">@Localizer["Title"]</h1>
1717
<p class="lead mb-4">
1818
@Localizer["SubTitle"]
1919
</p>
20-
<div class="d-flex flex-column flex-lg-row align-items-md-stretch justify-content-md-center gap-3 mb-4">
21-
<a href="introduction/" class="btn btn-lg bd-btn-lg btn-bd-primary d-flex align-items-center justify-content-center fw-semibold">
22-
<i class="fa-solid fa-book-open"></i>
23-
<span class="ms-2">@Localizer["Docs"]</span>
24-
</a>
25-
</div>
20+
<a href="introduction" class="btn btn-lg bd-btn-lg btn-bd-primary mb-4 d-inline-flex align-items-center justify-content-center fw-semibold">
21+
<i class="fa-solid fa-book-open"></i>
22+
<span class="ms-2">@Localizer["Docs"]</span>
23+
</a>
2624
<p class="text-body-secondary mb-0">
2725
Currently <strong>@_versionString</strong>
2826
<span class="px-1">·</span>

src/BootstrapBlazor.Server/Components/Pages/Index.razor.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
--bd-pink-rgb: 214, 51, 132;
55
--bd-violet-rgb: 112.520718, 44.062154, 249.437846;
66
--bd-accent-rgb: 255, 228, 132;
7-
padding-top: calc(3rem + var(--bs-header-height));
7+
padding-top: 3rem;
88
background-image: linear-gradient(180deg, rgba(var(--bs-body-bg-rgb), 0.01), rgba(var(--bs-body-bg-rgb), 1) 85%), radial-gradient(ellipse at top left, rgba(var(--bs-primary-rgb), 0.5), transparent 50%), radial-gradient(ellipse at top right, rgba(var(--bd-accent-rgb), 0.5), transparent 50%), radial-gradient(ellipse at center right, rgba(var(--bd-violet-rgb), 0.5), transparent 50%), radial-gradient(ellipse at center left, rgba(var(--bd-pink-rgb), 0.5), transparent 50%);
99
margin-top: calc(0px - var(--bs-header-height));
1010
}
@@ -88,10 +88,14 @@
8888
}
8989

9090
@media (min-width: 768px) {
91-
.bd-masthead .lead {
92-
font-size: calc(1.275rem + .3vw);
91+
.bd-masthead {
92+
padding-top: calc(3rem + var(--bs-header-height));
9393
}
9494

95+
.bd-masthead .lead {
96+
font-size: calc(1.275rem + .3vw);
97+
}
98+
9599
.welcome-header {
96100
margin-top: 0;
97101
margin-bottom: 0;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/affix"
2+
@using Microsoft.AspNetCore.Components.Rendering
23

34
<h3>@Localizer["AffixTitle"]</h3>
45

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ private async Task GetFingerCodeAsync()
1212
}</Pre>
1313
<BootstrapInputGroup>
1414
<BootstrapInputGroupLabel DisplayText="Browser-Finger"></BootstrapInputGroupLabel>
15-
<BootstrapInput @bind-Value="@_code" />
15+
<BootstrapInput Value="@_code" Readonly="true" />
16+
</BootstrapInputGroup>
17+
18+
<BootstrapInputGroup class="mt-3">
19+
<BootstrapInputGroupLabel DisplayText="ClientHubId"></BootstrapInputGroupLabel>
20+
<BootstrapInput Value="@_clientHubId" Readonly="true" />
1621
</BootstrapInputGroup>
1722
</DemoBlock>
1823

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public partial class BrowserFingers
1515
private IBrowserFingerService? BrowserFingerService { get; set; }
1616

1717
private string? _code;
18+
private string? _clientHubId;
1819

1920
/// <summary>
2021
/// <inheritdoc/>
@@ -25,10 +26,13 @@ protected override async Task OnInitializedAsync()
2526
await base.OnInitializedAsync();
2627

2728
_code = await GetFingerCodeAsync();
29+
_clientHubId = await GetClientHubIdAsync();
2830
}
2931

3032
private Task<string?> GetFingerCodeAsync() => BrowserFingerService.GetFingerCodeAsync();
3133

34+
private Task<string?> GetClientHubIdAsync() => BrowserFingerService.GetClientHubIdAsync();
35+
3236
private MethodItem[] GetMethods() =>
3337
[
3438
new()
@@ -37,6 +41,13 @@ private MethodItem[] GetMethods() =>
3741
Description = Localizer["GetFingerCodeAsync"],
3842
Parameters = " — ",
3943
ReturnValue = "Task<string?>"
44+
},
45+
new()
46+
{
47+
Name = "GetClientHubIdAsync",
48+
Description = Localizer["GetClientHubIdAsync"],
49+
Parameters = " — ",
50+
ReturnValue = "Task<string?>"
4051
}
4152
];
4253
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
text-align: center;
1212
}
1313
14+
@@media(max-width: 768px) {
1415
.otp-input-demo .bb-otp-input {
1516
--bb-otp-item-width: 32px;
1617
--bb-otp-font-size: 1.2em;
1718
}
19+
}
1820
</style>
1921
</HeadContent>
2022

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@page "/toolbar"
2+
@inject IStringLocalizer<Toolbars> Localizer
3+
4+
<h3>@Localizer["ToolbarsTitle"]</h3>
5+
6+
<h4>@((MarkupString)Localizer["ToolbarSubTitle"].Value)</h4>
7+
8+
<DemoBlock Title="@Localizer["NormalTitle"]"
9+
Introduction="@Localizer["NormalIntro"]"
10+
Name="Normal">
11+
<Toolbar IsWrap="true">
12+
<ToolbarItem>
13+
<Button Icon="fa-solid fa-wand-magic-sparkles" IsOutline="true"></Button>
14+
</ToolbarItem>
15+
<ToolbarItem>
16+
<CheckboxList IsButton="true" Items="_items2" @bind-Value="_item2" ShowButtonBorderColor="true">
17+
<ItemTemplate>
18+
<i class="@GetRadioIconByItem(context.Value)"></i>
19+
</ItemTemplate>
20+
</CheckboxList>
21+
</ToolbarItem>
22+
<ToolbarItem>
23+
<RadioList IsButton="true" Items="_items1" @bind-Value="_item1" ShowButtonBorderColor="true">
24+
<ItemTemplate>
25+
<i class="@GetIconByItem(context.Value)"></i>
26+
</ItemTemplate>
27+
</RadioList>
28+
</ToolbarItem>
29+
<ToolbarItem>
30+
<Select TValue="int" Color="Color.Primary" IsPopover="true" style="min-width: 120px;">
31+
<Options>
32+
<SelectOption Value="1" Text="Text 1"></SelectOption>
33+
<SelectOption Value="2" Text="Text 2"></SelectOption>
34+
<SelectOption Value="3" Text="Text 3"></SelectOption>
35+
</Options>
36+
</Select>
37+
</ToolbarItem>
38+
<ToolbarItem>
39+
<Dropdown TValue="string" Value="@_item3" Items="_items3" IsPopover="true"></Dropdown>
40+
</ToolbarItem>
41+
<ToolbarSpace></ToolbarSpace>
42+
<ToolbarButtonGroup>
43+
<Button Icon="fa-solid fa-save" IsOutline="true"></Button>
44+
<Button Icon="fa-solid fa-save" IsOutline="true"></Button>
45+
<Button Icon="fa-solid fa-save" IsOutline="true"></Button>
46+
</ToolbarButtonGroup>
47+
<ToolbarSeparator></ToolbarSeparator>
48+
<ToolbarButtonGroup>
49+
<Button Icon="fa-solid fa-save"></Button>
50+
<Button Icon="fa-solid fa-save"></Button>
51+
<Button Icon="fa-solid fa-save"></Button>
52+
</ToolbarButtonGroup>
53+
</Toolbar>
54+
</DemoBlock>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
/// Toolbar 组件示例代码
10+
/// </summary>
11+
public partial class Toolbars
12+
{
13+
private readonly List<SelectedItem> _items1 = [];
14+
private string _item1 = "1,2";
15+
16+
private readonly List<SelectedItem> _items2 = [];
17+
private string _item2 = "1";
18+
19+
private readonly List<SelectedItem> _items3 = [];
20+
private string _item3 = "1";
21+
22+
/// <summary>
23+
/// <inheritdoc/>
24+
/// </summary>
25+
protected override void OnInitialized()
26+
{
27+
base.OnInitialized();
28+
29+
_items1.Add(new SelectedItem("1", "Text1"));
30+
_items1.Add(new SelectedItem("2", "Text2"));
31+
_items1.Add(new SelectedItem("3", "Text3"));
32+
33+
_items2.Add(new SelectedItem("1", "Text1"));
34+
_items2.Add(new SelectedItem("2", "Text2"));
35+
_items2.Add(new SelectedItem("3", "Text3"));
36+
37+
_items3.Add(new SelectedItem("1", "Text1"));
38+
_items3.Add(new SelectedItem("2", "Text2"));
39+
_items3.Add(new SelectedItem("3", "Text3"));
40+
}
41+
42+
private static string GetIconByItem(string v) => v switch
43+
{
44+
"1" => "fa-solid fa-align-left",
45+
"2" => "fa-solid fa-align-center",
46+
_ => "fa-solid fa-align-right"
47+
};
48+
49+
private static string GetRadioIconByItem(string v) => v switch
50+
{
51+
"1" => "fa-solid fa-bold",
52+
"2" => "fa-solid fa-italic",
53+
_ => "fa-solid fa-font"
54+
};
55+
}

src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,12 @@ void AddLayout(DemoMenuItem item)
14861486
{
14871487
Text = Localizer["Stack"],
14881488
Url = "stack"
1489+
},
1490+
new()
1491+
{
1492+
IsNew = true,
1493+
Text = Localizer["Toolbar"],
1494+
Url = "toolbar"
14891495
}
14901496
};
14911497
AddBadge(item);

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4845,7 +4845,8 @@
48454845
"DataPackageAdapter": "DataPackageAdapter",
48464846
"SocketAutoConnect": "Reconnect",
48474847
"SocketDataEntity": "DataEntity",
4848-
"NetworkMonitor": "Network Monitor"
4848+
"NetworkMonitor": "Network Monitor",
4849+
"Toolbar": "Toolbar"
48494850
},
48504851
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
48514852
"TablesHeaderTitle": "Header grouping function",
@@ -6687,7 +6688,8 @@
66876688
"BootstrapBlazor.Server.Components.Samples.BrowserFingers": {
66886689
"BrowserFingerTitle": "Browser fingerprint",
66896690
"BrowserFingerIntro": "Obtain the client browser fingerprint by calling the <code>IBrowserFingerService</code> service instance method <code>GetFingerCodeAsync</code>. The fingerprint is consistent in privacy mode",
6690-
"GetFingerCodeAsync": "Method for obtaining fingerprints"
6691+
"GetFingerCodeAsync": "Method for obtaining fingerprints",
6692+
"GetClientHubIdAsync": "Method for obtaining client hub Id"
66916693
},
66926694
"BootstrapBlazor.Server.Components.Samples.SvgEditors": {
66936695
"SvgEditorTitle": "SvgEditor",
@@ -7150,5 +7152,11 @@
71507152
"IndicatorLi2": "Yellow: Average network (3G)",
71517153
"IndicatorLi3": "Red: Poor network (2G)",
71527154
"IndicatorLi4": "Gray: Offline"
7155+
},
7156+
"BootstrapBlazor.Server.Components.Samples.Toolbars": {
7157+
"ToolbarsTitle": "Toolbar",
7158+
"ToolbarSubTitle": "ToolBar component is a container for buttons or other application-specific tools",
7159+
"NormalTitle": "Normal",
7160+
"NormalIntro": ""
71537161
}
71547162
}

0 commit comments

Comments
 (0)