Skip to content

Commit 3ad5529

Browse files
committed
添加复现demo
1 parent 39ad96c commit 3ad5529

65 files changed

Lines changed: 1508 additions & 0 deletions

Some content is hidden

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

BootstrapBlazor.Extensions.slnx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@
9393
<Project Path="src/components/BootstrapBlazor.WebAPI/BootstrapBlazor.WebAPI.csproj" />
9494
<Project Path="src/components/BootstrapBlazor.WinBox/BootstrapBlazor.WinBox.csproj" />
9595
</Folder>
96+
<Folder Name="/src/demo/">
97+
<Project Path="BootstrapBlazorApp1/BootstrapBlazorApp1.Server/BootstrapBlazorApp1.Server.csproj" Id="916808f0-27e8-4558-bcf4-6d4a6621cd1c" />
98+
</Folder>
9699
<Folder Name="/src/extensions/">
97100
<Project Path="src/extensions/BootstrapBlazor.DataAccess.EntityFrameworkCore/BootstrapBlazor.DataAccess.EntityFrameworkCore.csproj" />
98101
<Project Path="src/extensions/BootstrapBlazor.DataAccess.FreeSql/BootstrapBlazor.DataAccess.FreeSql.csproj" />

BootstrapBlazorApp1/.editorconfig

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2+
###############################
3+
# Core EditorConfig Options #
4+
###############################
5+
root = true
6+
7+
# All files
8+
[*]
9+
indent_style = space
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
# Code files
15+
[*.{cs,csx,vb,vbx}]
16+
indent_size = 4
17+
18+
[*.{cs,css,js,json,*html,razor,txt,log}]
19+
charset = utf-8-bom
20+
21+
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]
22+
indent_size = 2
23+
24+
# Xml config files
25+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
26+
indent_size = 2
27+
28+
[*.json]
29+
indent_size = 2
30+
31+
[*.{ps1,psm1}]
32+
indent_size = 4
33+
34+
[*.sh]
35+
indent_size = 4
36+
end_of_line = lf
37+
38+
###############################
39+
# .NET Coding Conventions #
40+
###############################
41+
[*.{cs,vb}]
42+
# Organize usings
43+
dotnet_sort_system_directives_first = false
44+
# this. preferences
45+
dotnet_style_qualification_for_field = false:silent
46+
dotnet_style_qualification_for_property = false:silent
47+
dotnet_style_qualification_for_method = false:silent
48+
dotnet_style_qualification_for_event = false:silent
49+
# Language keywords vs BCL types preferences
50+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
51+
dotnet_style_predefined_type_for_member_access = true:silent
52+
# Parentheses preferences
53+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
54+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
55+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
56+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
57+
# Modifier preferences
58+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
59+
dotnet_style_readonly_field = true:suggestion
60+
# Expression-level preferences
61+
dotnet_style_object_initializer = true:suggestion
62+
dotnet_style_collection_initializer = true:suggestion
63+
dotnet_style_explicit_tuple_names = true:suggestion
64+
dotnet_style_null_propagation = true:suggestion
65+
dotnet_style_coalesce_expression = true:suggestion
66+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
67+
dotnet_prefer_inferred_tuple_names = true:suggestion
68+
dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
69+
dotnet_style_prefer_auto_properties = true:silent
70+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
71+
dotnet_style_prefer_conditional_expression_over_return = true:silent
72+
###############################
73+
# Naming Conventions #
74+
###############################
75+
# Style Definitions
76+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
77+
# Use PascalCase for constant fields
78+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
79+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
80+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
81+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
82+
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
83+
dotnet_naming_symbols.constant_fields.required_modifiers = const
84+
###############################
85+
# C# Coding Conventions #
86+
###############################
87+
[*.cs]
88+
# var preferences
89+
csharp_style_var_for_built_in_types = true:silent
90+
csharp_style_var_when_type_is_apparent = true:silent
91+
csharp_style_var_elsewhere = true:silent
92+
# Expression-bodied members
93+
csharp_style_expression_bodied_methods = false:silent
94+
csharp_style_expression_bodied_constructors = false:silent
95+
csharp_style_expression_bodied_operators = false:silent
96+
csharp_style_expression_bodied_properties = true:silent
97+
csharp_style_expression_bodied_indexers = true:silent
98+
csharp_style_expression_bodied_accessors = true:silent
99+
# Pattern matching preferences
100+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
101+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
102+
# Null-checking preferences
103+
csharp_style_throw_expression = true:suggestion
104+
csharp_style_conditional_delegate_call = true:suggestion
105+
# Modifier preferences
106+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
107+
# Expression-level preferences
108+
csharp_prefer_braces = true:silent
109+
csharp_style_deconstructed_variable_declaration = true:suggestion
110+
csharp_prefer_simple_default_expression = true:suggestion
111+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
112+
csharp_style_inlined_variable_declaration = true:suggestion
113+
###############################
114+
# C# Formatting Rules #
115+
###############################
116+
# New line preferences
117+
csharp_new_line_before_open_brace = all
118+
csharp_new_line_before_else = true
119+
csharp_new_line_before_catch = true
120+
csharp_new_line_before_finally = true
121+
csharp_new_line_before_members_in_object_initializers = true
122+
csharp_new_line_before_members_in_anonymous_types = true
123+
csharp_new_line_between_query_expression_clauses = true
124+
# Indentation preferences
125+
csharp_indent_case_contents = true
126+
csharp_indent_switch_labels = true
127+
csharp_indent_labels = flush_left
128+
# Space preferences
129+
csharp_space_after_cast = false
130+
csharp_space_after_keywords_in_control_flow_statements = true
131+
csharp_space_between_method_call_parameter_list_parentheses = false
132+
csharp_space_between_method_declaration_parameter_list_parentheses = false
133+
csharp_space_between_parentheses = false
134+
csharp_space_before_colon_in_inheritance_clause = true
135+
csharp_space_after_colon_in_inheritance_clause = true
136+
csharp_space_around_binary_operators = before_and_after
137+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
138+
csharp_space_between_method_call_name_and_opening_parenthesis = false
139+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
140+
# Wrapping preferences
141+
csharp_preserve_single_line_statements = true
142+
csharp_preserve_single_line_blocks = true
143+
###############################
144+
# VB Coding Conventions #
145+
###############################
146+
[*.vb]
147+
# Modifier preferences
148+
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
149+
[*.cs]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35507.96 d17.13
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazorApp1.Server", "BootstrapBlazorApp1.Server\BootstrapBlazorApp1.Server.csproj", "{DDEF701E-5B57-223F-89FC-B3C7019FA8CC}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{DDEF701E-5B57-223F-89FC-B3C7019FA8CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{DDEF701E-5B57-223F-89FC-B3C7019FA8CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{DDEF701E-5B57-223F-89FC-B3C7019FA8CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{DDEF701E-5B57-223F-89FC-B3C7019FA8CC}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {F4C4EDBB-8F4A-445D-8316-BD89AABB2B13}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Content Remove="Locales\en.json" />
11+
<Content Remove="Locales\zh.json" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<EmbeddedResource Include="Locales\en.json" />
16+
<EmbeddedResource Include="Locales\zh.json" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="BootstrapBlazor" Version="10.*" />
21+
<PackageReference Include="BootstrapBlazor.FontAwesome" Version="10.*" />
22+
<PackageReference Include="BootstrapBlazor.Html2Pdf" Version="10.*" />
23+
<PackageReference Include="BootstrapBlazor.TableExport" Version="10.*" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<ProjectReference Include="..\..\src\components\BootstrapBlazor.CodeEditor\BootstrapBlazor.CodeEditor.csproj" />
28+
</ItemGroup>
29+
30+
</Project>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
@inject IHostEnvironment Env
2+
@inject IStringLocalizer<App> Localizer
3+
4+
<!DOCTYPE html>
5+
<html lang="en" data-bs-theme='light'>
6+
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
10+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
12+
<meta name="keywords" content="bootstrap,blazor,wasm,webassembly,UI,netcore,web,assembly">
13+
<meta name="description" content="基于 Bootstrap 风格的 Blazor UI 组件库,用于研发企业级中后台产品。">
14+
<meta name="author" content="argo (argo@live.ca)">
15+
<base href="/" />
16+
17+
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css"]" />
18+
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css"]" />
19+
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor/css/motronic.min.css"]" />
20+
<link rel="stylesheet" href="@Assets["BootstrapBlazorApp1.Server.styles.css"]" />
21+
<link rel="stylesheet" href="@Assets["css/app.css"]" />
22+
<ImportMap />
23+
24+
<link rel="icon" href="favicon.ico" type="image/x-icon" />
25+
26+
<title>Bootstrap Blazor Server App</title>
27+
<HeadOutlet @rendermode="new InteractiveServerRenderMode(false)" />
28+
</head>
29+
30+
<body>
31+
<Routes @rendermode="new InteractiveServerRenderMode(false)" />
32+
33+
<ReconnectorOutlet ReconnectInterval="5000" @rendermode="new InteractiveServerRenderMode(false)" />
34+
35+
<script src="@Assets["_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js"]"></script>
36+
<script src="_framework/blazor.web.js"></script>
37+
</body>
38+
39+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div class="@ClassString" @onclick="TriggerClick">
2+
<LayoutThumbnail IsFullSide="@IsFullSide"></LayoutThumbnail>
3+
</div>
4+
5+
@code {
6+
[Parameter]
7+
public bool IsFullSide { get; set; }
8+
9+
[Parameter]
10+
public bool IsActive { get; set; }
11+
12+
[Parameter, NotNull, EditorRequired]
13+
public Func<bool, Task>? OnClick { get; set; }
14+
15+
private string? ClassString => CssBuilder.Default("layout-preview")
16+
.AddClass("active", IsActive)
17+
.Build();
18+
19+
private async Task TriggerClick()
20+
{
21+
await OnClick(IsFullSide);
22+
}
23+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.layout-preview {
2+
font-size: 9px;
3+
border-radius: 4px;
4+
padding: 4px;
5+
cursor: pointer;
6+
border: 2px solid #c0c4cc;
7+
transition: border .3s linear;
8+
}
9+
10+
.layout-preview:hover {
11+
border: 2px solid #28a745;
12+
}
13+
14+
.layout-preview.active {
15+
border: 2px solid #28a745;
16+
}
17+
18+
::deep .layout {
19+
--bb-layout-height: 80px;
20+
--bb-layout-header-height: 16px;
21+
--bb-layout-footer-height: 12px;
22+
--bb-layout-sidebar-width: 30%;
23+
--bb-layout-banner-font-size: 9px;
24+
--bb-layout-title-color: #fff;
25+
border: 1px solid var(--bb-layout-header-background);
26+
}
27+
28+
::deep .layout .layout-footer,
29+
::deep .layout .layout-header {
30+
justify-content: center;
31+
}
32+
33+
::deep .layout .layout-menu {
34+
display: flex;
35+
align-items: center;
36+
justify-content: center;
37+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@if (IsFullSide)
2+
{
3+
<section class="layout has-sidebar has-footer">
4+
<aside class="layout-side">
5+
<div class="layout-banner"><div class="layout-title">Logo</div></div>
6+
<div class="layout-menu">Menu</div>
7+
</aside>
8+
<section class="layout-right">
9+
<header class="layout-header">
10+
Header
11+
</header><main class="layout-main">
12+
Main
13+
</main><footer class="layout-footer">
14+
Footer
15+
</footer>
16+
</section>
17+
</section>
18+
}
19+
else
20+
{
21+
<section class="layout has-footer">
22+
<header class="layout-header">
23+
Header
24+
</header>
25+
<section class="has-sidebar">
26+
<aside class="layout-side">
27+
<div class="layout-banner">
28+
<div class="layout-title">Logo</div>
29+
</div>
30+
<div class="layout-menu">Menu</div>
31+
</aside>
32+
<main class="layout-main">
33+
Main
34+
</main>
35+
</section><footer class="layout-footer">
36+
Footer
37+
</footer>
38+
</section>
39+
}
40+
41+
@code {
42+
[Parameter]
43+
public bool IsFullSide { get; set; }
44+
}

0 commit comments

Comments
 (0)