-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(Toolbar): add Toolbar component #6547
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
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
b3088bb
feat: 增加 Toolbar 组件
ArgoZhang 0ef8c1d
refactor: 增加命名空间
ArgoZhang 810635b
doc: 增加本地化
ArgoZhang ed58117
doc: 增加源码映射
ArgoZhang 746031f
doc: 增加工具栏菜单
ArgoZhang 4d98f98
doc: 增加工具栏示例
ArgoZhang 23a42ad
refactor: 更新内部实现逻辑
ArgoZhang 4d111c4
doc: 更新示例
ArgoZhang 49aa9db
doc: 增加注释
ArgoZhang 7dc39eb
refactor: 重构组件名称
ArgoZhang 705ab04
doc: 更新示例
ArgoZhang 9296de8
Merge branch 'main' into feat-toolbar
ArgoZhang 92f422b
feat(CheckboxLIst): support ItemTemplate on Button mode
ArgoZhang d3fb754
refactor: 代码格式化
ArgoZhang c333b75
feat(RadioLIst): support ItemTemplate on Button mode
ArgoZhang 8ff8664
feat: 增加 IsWrap 参数
ArgoZhang 9472713
doc: 更新示例
ArgoZhang 3c32e07
doc: 更新示例
ArgoZhang 5e2365c
feat(CheckboxList): add ShowButtonBorderColor parameter
ArgoZhang 51286d7
feat(RadioList): add ShowButtonBorderColor parameter
ArgoZhang 1fe3170
refactor: 精简样式名称
ArgoZhang 2a29bb5
test: 更新示例
ArgoZhang f309036
test: 增加单元测试
ArgoZhang 60d3300
Merge branch 'main' into feat-toolbar
ArgoZhang 4580ec1
chore: bump version 9.9.1-beta06
ArgoZhang 5378783
test: 更新单元测试
ArgoZhang 4bb21df
Merge branch 'main' into feat-toolbar
ArgoZhang 0d447b7
test: 增加功能测试
ArgoZhang b39d269
revert: 撤销更改
ArgoZhang b2dc727
test: 增加单元测试
ArgoZhang bb25bca
refactor: 增加 disposing 参数使用
ArgoZhang bbd3a21
refactor: 更改代码消除异常
ArgoZhang ad716a2
doc: 更新样式
ArgoZhang c68e238
test: 增加单元测试
ArgoZhang f078893
test: 增加单元测试
ArgoZhang 9f16fb4
test: 增加单元测试
ArgoZhang 663f5a5
test: 增加单元测试
ArgoZhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| @page "/affix" | ||
| @using Microsoft.AspNetCore.Components.Rendering | ||
|
|
||
| <h3>@Localizer["AffixTitle"]</h3> | ||
|
|
||
|
|
||
54 changes: 54 additions & 0 deletions
54
src/BootstrapBlazor.Server/Components/Samples/Toolbars.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| @page "/toolbar" | ||
| @inject IStringLocalizer<Toolbars> Localizer | ||
|
|
||
| <h3>@Localizer["ToolbarsTitle"]</h3> | ||
|
|
||
| <h4>@((MarkupString)Localizer["ToolbarSubTitle"].Value)</h4> | ||
|
|
||
| <DemoBlock Title="@Localizer["NormalTitle"]" | ||
| Introduction="@Localizer["NormalIntro"]" | ||
| Name="Normal"> | ||
| <Toolbar IsWrap="true"> | ||
| <ToolbarItem> | ||
| <Button Icon="fa-solid fa-wand-magic-sparkles" IsOutline="true"></Button> | ||
| </ToolbarItem> | ||
| <ToolbarItem> | ||
| <CheckboxList IsButton="true" Items="_items2" @bind-Value="_item2" ShowButtonBorderColor="true"> | ||
| <ItemTemplate> | ||
| <i class="@GetRadioIconByItem(context.Value)"></i> | ||
| </ItemTemplate> | ||
| </CheckboxList> | ||
| </ToolbarItem> | ||
| <ToolbarItem> | ||
| <RadioList IsButton="true" Items="_items1" @bind-Value="_item1" ShowButtonBorderColor="true"> | ||
| <ItemTemplate> | ||
| <i class="@GetIconByItem(context.Value)"></i> | ||
| </ItemTemplate> | ||
| </RadioList> | ||
| </ToolbarItem> | ||
| <ToolbarItem> | ||
| <Select TValue="int" Color="Color.Primary" IsPopover="true" style="min-width: 120px;"> | ||
| <Options> | ||
| <SelectOption Value="1" Text="Text 1"></SelectOption> | ||
| <SelectOption Value="2" Text="Text 2"></SelectOption> | ||
| <SelectOption Value="3" Text="Text 3"></SelectOption> | ||
| </Options> | ||
| </Select> | ||
| </ToolbarItem> | ||
| <ToolbarItem> | ||
| <Dropdown TValue="string" Value="@_item3" Items="_items3" IsPopover="true"></Dropdown> | ||
| </ToolbarItem> | ||
| <ToolbarSpace></ToolbarSpace> | ||
| <ToolbarButtonGroup> | ||
| <Button Icon="fa-solid fa-save" IsOutline="true"></Button> | ||
| <Button Icon="fa-solid fa-save" IsOutline="true"></Button> | ||
| <Button Icon="fa-solid fa-save" IsOutline="true"></Button> | ||
| </ToolbarButtonGroup> | ||
| <ToolbarSeparator></ToolbarSeparator> | ||
| <ToolbarButtonGroup> | ||
| <Button Icon="fa-solid fa-save"></Button> | ||
| <Button Icon="fa-solid fa-save"></Button> | ||
| <Button Icon="fa-solid fa-save"></Button> | ||
| </ToolbarButtonGroup> | ||
| </Toolbar> | ||
| </DemoBlock> |
55 changes: 55 additions & 0 deletions
55
src/BootstrapBlazor.Server/Components/Samples/Toolbars.razor.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // 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([email protected]) Website: https://www.blazor.zone | ||
|
|
||
| namespace BootstrapBlazor.Server.Components.Samples; | ||
|
|
||
| /// <summary> | ||
| /// Toolbar 组件示例代码 | ||
| /// </summary> | ||
| public partial class Toolbars | ||
| { | ||
| private readonly List<SelectedItem> _items1 = []; | ||
| private string _item1 = "1,2"; | ||
|
|
||
| private readonly List<SelectedItem> _items2 = []; | ||
| private string _item2 = "1"; | ||
|
|
||
| private readonly List<SelectedItem> _items3 = []; | ||
| private string _item3 = "1"; | ||
|
|
||
| /// <summary> | ||
| /// <inheritdoc/> | ||
| /// </summary> | ||
| protected override void OnInitialized() | ||
| { | ||
| base.OnInitialized(); | ||
|
|
||
| _items1.Add(new SelectedItem("1", "Text1")); | ||
| _items1.Add(new SelectedItem("2", "Text2")); | ||
| _items1.Add(new SelectedItem("3", "Text3")); | ||
|
|
||
| _items2.Add(new SelectedItem("1", "Text1")); | ||
| _items2.Add(new SelectedItem("2", "Text2")); | ||
| _items2.Add(new SelectedItem("3", "Text3")); | ||
|
|
||
| _items3.Add(new SelectedItem("1", "Text1")); | ||
| _items3.Add(new SelectedItem("2", "Text2")); | ||
| _items3.Add(new SelectedItem("3", "Text3")); | ||
| } | ||
|
|
||
| private static string GetIconByItem(string v) => v switch | ||
| { | ||
| "1" => "fa-solid fa-align-left", | ||
| "2" => "fa-solid fa-align-center", | ||
| _ => "fa-solid fa-align-right" | ||
| }; | ||
|
|
||
| private static string GetRadioIconByItem(string v) => v switch | ||
| { | ||
| "1" => "fa-solid fa-bold", | ||
| "2" => "fa-solid fa-italic", | ||
| _ => "fa-solid fa-font" | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| @namespace BootstrapBlazor.Components | ||
| @inherits IdComponentBase | ||
|
|
||
| <div @attributes="AdditionalAttributes" class="@ClassString" role="toolbar" aria-label="toolbar" style="@StyleString"> | ||
| <CascadingValue Value="this" IsFixed="true"> | ||
| @ChildContent | ||
| </CascadingValue> | ||
| </div> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.