Skip to content

Commit 4bb21df

Browse files
committed
Merge branch 'main' into feat-toolbar
2 parents 5378783 + 0b6c36e commit 4bb21df

File tree

15 files changed

+77
-27
lines changed

15 files changed

+77
-27
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,20 @@
77
<section class="bd-masthead">
88
<div class="container-xxl bd-gutter">
99
<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">
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/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

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6688,7 +6688,8 @@
66886688
"BootstrapBlazor.Server.Components.Samples.BrowserFingers": {
66896689
"BrowserFingerTitle": "Browser fingerprint",
66906690
"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",
6691-
"GetFingerCodeAsync": "Method for obtaining fingerprints"
6691+
"GetFingerCodeAsync": "Method for obtaining fingerprints",
6692+
"GetClientHubIdAsync": "Method for obtaining client hub Id"
66926693
},
66936694
"BootstrapBlazor.Server.Components.Samples.SvgEditors": {
66946695
"SvgEditorTitle": "SvgEditor",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6688,7 +6688,8 @@
66886688
"BootstrapBlazor.Server.Components.Samples.BrowserFingers": {
66896689
"BrowserFingerTitle": "浏览器指纹",
66906690
"BrowserFingerIntro": "通过调用 <code>IBrowserFingerService</code> 服务实例方法 <code>GetFingerCodeAsync</code> 获得客户端浏览器指纹,隐私模式下指纹是一致的",
6691-
"GetFingerCodeAsync": "获得指纹方法"
6691+
"GetFingerCodeAsync": "获得指纹方法",
6692+
"GetClientHubIdAsync": "获得客户端连接 Id 方法"
66926693
},
66936694
"BootstrapBlazor.Server.Components.Samples.SvgEditors": {
66946695
"SvgEditorTitle": "Svg 编辑器",

src/BootstrapBlazor/Components/InputNumber/BootstrapInputNumber.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public partial class BootstrapInputNumber<TValue>
9393

9494
[Inject]
9595
[NotNull]
96-
private IOptions<BootstrapBlazorOptions>? StepOption { get; set; }
96+
private IOptionsMonitor<BootstrapBlazorOptions>? StepOption { get; set; }
9797

9898
private string? _lastInputValueString;
9999

@@ -123,7 +123,7 @@ protected override void OnParametersSet()
123123
MinusIcon ??= IconTheme.GetIconByKey(ComponentIcons.InputNumberMinusIcon);
124124
PlusIcon ??= IconTheme.GetIconByKey(ComponentIcons.InputNumberPlusIcon);
125125

126-
StepString = Step ?? StepOption.Value.GetStep<TValue>() ?? "any";
126+
StepString = Step ?? StepOption.CurrentValue.GetStep<TValue>() ?? "any";
127127

128128
if (Value is null)
129129
{

src/BootstrapBlazor/Components/ValidateForm/ValidateForm.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public partial class ValidateForm
9696

9797
[Inject]
9898
[NotNull]
99-
private IOptions<JsonLocalizationOptions>? Options { get; set; }
99+
private IOptionsMonitor<JsonLocalizationOptions>? Options { get; set; }
100100

101101
[Inject]
102102
[NotNull]
@@ -388,7 +388,7 @@ private void ValidateDataAnnotations(object? value, ValidationContext context, L
388388
var find = false;
389389
if (!string.IsNullOrEmpty(rule.ErrorMessage))
390390
{
391-
var resourceType = Options.Value.ResourceManagerStringLocalizerType;
391+
var resourceType = Options.CurrentValue.ResourceManagerStringLocalizerType;
392392
if (resourceType != null && LocalizerFactory.Create(resourceType).TryGetLocalizerString(rule.ErrorMessage, out var text))
393393
{
394394
rule.ErrorMessage = text;

src/BootstrapBlazor/Services/DefaultBrowserFingerService.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ class DefaultBrowserFingerService(IJSRuntime jSRuntime) : IBrowserFingerService
1313
[NotNull]
1414
private JSModule? _module = null;
1515

16-
/// <summary>
17-
/// 获取剪切板数据方法
18-
/// </summary>
1916
public async Task<string?> GetFingerCodeAsync(CancellationToken token = default)
2017
{
2118
_module ??= await jSRuntime.LoadUtility();
2219
return await _module.InvokeAsync<string?>("getFingerCode", token);
2320
}
21+
22+
public async Task<string?> GetClientHubIdAsync(CancellationToken token = default)
23+
{
24+
_module ??= await jSRuntime.LoadUtility();
25+
return await _module.InvokeAsync<string?>("getClientHubId", token);
26+
}
2427
}

0 commit comments

Comments
 (0)