-
-
Notifications
You must be signed in to change notification settings - Fork 383
doc(FullScreenButton): add FullScreenOption documentation #6005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
eff512c
8c082fd
f5c6150
4ecc6a2
05b061f
671b349
07c00e8
202cec0
eabaf85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| @page "/fullscreen-button" | ||
| @inject IStringLocalizer<FullScreenButtons> Localizer | ||
|
|
||
| <h3>@Localizer["FullScreenButtonTitle"]</h3> | ||
|
|
||
| <h4>@((MarkupString)Localizer["FullScreenButtonIntro"].Value)</h4> | ||
|
|
||
| <DemoBlock Title="@Localizer["FullScreenButtonNormalTitle"]" Introduction="@Localizer["FullScreenButtonNormalIntro"]" Name="Normal"> | ||
| <section ignore> | ||
| <ul class="ul-demo mb-3"> | ||
| <li>@((MarkupString)Localizer["FullScreenTitleLi1"].Value)</li> | ||
| <li>@((MarkupString)Localizer["FullScreenTitleLi2"].Value)</li> | ||
| </ul> | ||
| </section> | ||
| <FullScreenButton Icon="fa-solid fa-font-awesome"></FullScreenButton> | ||
| </DemoBlock> | ||
|
|
||
| <AttributeTable Items="@GetAttributes()" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the Apache 2.0 License | ||
| // See the LICENSE file in the project root for more information. | ||
| // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone | ||
|
|
||
| namespace BootstrapBlazor.Server.Components.Samples; | ||
|
|
||
| /// <summary> | ||
| /// 全屏按钮代码示例 | ||
| /// </summary> | ||
| public partial class FullScreenButtons | ||
| { | ||
| /// <summary> | ||
| /// GetAttributes | ||
| /// </summary> | ||
| /// <returns></returns> | ||
| private static AttributeItem[] GetAttributes() => | ||
| [ | ||
| new() | ||
| { | ||
| Name = nameof(FullScreenButton.Icon), | ||
| Description = "全屏图标", | ||
| Type = "string", | ||
| ValueList = " — ", | ||
| DefaultValue = " — " | ||
| }, | ||
| new() | ||
| { | ||
| Name = nameof(FullScreenButton.FullScreenExitIcon), | ||
| Description = "退出全屏图标", | ||
| Type = "string", | ||
| ValueList = " — ", | ||
| DefaultValue = " — " | ||
| }, | ||
| new() | ||
| { | ||
| Name = nameof(FullScreenButton.TargetId), | ||
| Description = "全屏元素 Id", | ||
| Type = "string", | ||
| ValueList = " — ", | ||
| DefaultValue = " — " | ||
| }, | ||
| new() | ||
| { | ||
| Name = nameof(FullScreenButton.Text), | ||
| Description = "显示文字", | ||
| Type = "string", | ||
| ValueList = " — ", | ||
| DefaultValue = " — " | ||
| } | ||
| ]; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the Apache 2.0 License | ||
| // See the LICENSE file in the project root for more information. | ||
| // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone | ||
|
|
||
| namespace BootstrapBlazor.Server.Components.Samples; | ||
|
|
||
| /// <summary> | ||
| /// FullScreen Service | ||
| /// </summary> | ||
| public partial class FullScreens | ||
| { | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,9 +88,10 @@ public async Task Toggle_Ok() | |
| [Fact] | ||
| public void FullScreenOption_Ok() | ||
| { | ||
| var option = new FullScreenOption() { Element = new("test01", null), Id = "test" }; | ||
| var option = new FullScreenOption() { Element = new("test01", null), Id = "test", Selector = "test-selector" }; | ||
| Assert.NotNull(option.Id); | ||
| Assert.Null(option.Element.Context); | ||
| Assert.Null(option.Selector); | ||
|
ArgoZhang marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (testing): Incorrect assertion for You initialized Selector to "test-selector", so |
||
| } | ||
|
|
||
| private class MockFullScreen : ComponentBase | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Added CSS selector based lookup for full-screen elements.
Validate options.selector to prevent querySelector errors and unexpected behavior.