Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 1 addition & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,5 @@ dotnet_style_qualification_for_method = false
# IDE0065: Misplaced using directive
csharp_using_directive_placement = outside_namespace

# CA1835: Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes
dotnet_diagnostic.CA1835.severity = error

# CA1849: Call async methods when in an async method
dotnet_diagnostic.CA1849.severity = error

dotnet_diagnostic.CA2000.severity = error

# CA2007: Do not directly await a Task
dotnet_diagnostic.CA2007.severity = error

# CA2016: Forward the CancellationToken parameter to methods that take one
dotnet_diagnostic.CA2016.severity = error

# IDE0161: Use file-scoped namespace
csharp_style_namespace_declarations = file_scoped:silent
12 changes: 6 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
working-directory: ./benchmarks/MiniExcel.Benchmarks
- name: Build
run: dotnet build --no-restore
working-directory: ./benchmarks/MiniExcel.Benchmarks
- name: Benchmark
run: dotnet run -c Release -f net9.0
run: dotnet run -c Release -f net10.0
working-directory: ./benchmarks/MiniExcel.Benchmarks
env:
BenchmarkMode: Automatic
Expand All @@ -48,15 +48,15 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
working-directory: ./benchmarks/MiniExcel.Benchmarks
- name: Build
run: dotnet build --no-restore
working-directory: ./benchmarks/MiniExcel.Benchmarks
- name: Benchmark
run: dotnet run -c Release -f net9.0
run: dotnet run -c Release -f net10.0
working-directory: ./benchmarks/MiniExcel.Benchmarks
env:
BenchmarkMode: Automatic
Expand All @@ -78,15 +78,15 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
working-directory: ./benchmarks/MiniExcel.Benchmarks
- name: Build
run: dotnet build --no-restore
working-directory: ./benchmarks/MiniExcel.Benchmarks
- name: Benchmark
run: dotnet run -c Release -f net9.0
run: dotnet run -c Release -f net10.0
working-directory: ./benchmarks/MiniExcel.Benchmarks
env:
BenchmarkMode: Automatic
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
# uses a compiled language

- name: Manual build
run: dotnet build MiniExcel.slnx --no-restore --configuration Release
run: dotnet build MiniExcel.slnx -c Release -f net10.0

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
7 changes: 4 additions & 3 deletions MiniExcel.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Project Path="benchmarks\MiniExcel.Benchmarks\MiniExcel.Benchmarks.csproj" />
</Folder>
<Folder Name="/Docs and settings/">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="appveyor.yml" />
Expand All @@ -13,9 +14,7 @@
<File Path="README.zh-CN.md" />
<File Path=".github\workflows\benchmark.yml" />
<File Path=".github\workflows\codeql-analysis.yml" />
<File Path="src\Directory.Build.props" />
<File Path="README-V2.md" />
<File Path="src\Directory.Packages.props" />
<File Path="miniexcel.publickey" />
<File Path="src\icon.png" />
<File Path="V2-Upgrade-Notes.md" />
Expand All @@ -26,9 +25,11 @@
<File Path="docs\README.zh-Hant.md" />
</Folder>
<Folder Name="/src/">
<File Path="src\Directory.Build.props" />
<File Path="src\Directory.Packages.props" />
<Project Path="src\MiniExcel.Core\MiniExcel.Core.csproj" />
<Project Path="src\MiniExcel.Csv\MiniExcel.Csv.csproj" />
<Project Path="src\MiniExcel\MiniExcel.csproj" Type="Classic C#" />
<Project Path="src\MiniExcel\MiniExcel.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/MiniExcel.Benchmarks/MiniExcel.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net9.0;net10.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
Expand All @@ -11,13 +11,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
<PackageReference Include="ClosedXML" Version="0.105.0" />
<PackageReference Include="ClosedXML.Report" Version="0.2.12" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
<PackageReference Include="EPPlus" Version="7.7.2" />
<PackageReference Include="ExcelDataReader" Version="3.7.0" />
<PackageReference Include="NPOI" Version="2.7.3" />
<PackageReference Include="NPOI" Version="2.7.5" />
</ItemGroup>

<ItemGroup>
Expand Down
37 changes: 37 additions & 0 deletions samples/MiniExcel.Samples.Blazor/Components/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<base href="/"/>
<ResourcePreloader/>
<link rel="stylesheet" href="@Assets["lib/bootstrap/bootstrap.min.css"]"/>
<link rel="stylesheet" href="@Assets["app.css"]"/>
<link rel="stylesheet" href="@Assets["MiniExcel.Samples.Blazor.styles.css"]"/>
<ImportMap/>
<link rel="icon" type="image/png" href="favicon.png"/>
<HeadOutlet @rendermode="InteractiveServer"/>
</head>

<body>
<Routes @rendermode="InteractiveServer"/>
<ReconnectModal/>
<script src="@Assets["_framework/blazor.web.js"]"></script>

<script>
downloadFileFromStream = async (fileName, contentStreamReference) => {
const arrayBuffer = await contentStreamReference.arrayBuffer();
const blob = new Blob([arrayBuffer]);
const url = URL.createObjectURL(blob);
const anchorElement = document.createElement('a');
anchorElement.href = url;
anchorElement.download = fileName ?? '';
anchorElement.click();
anchorElement.remove();
URL.revokeObjectURL(url);
}
</script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@inherits LayoutComponentBase

<div class="page">
<div class="sidebar">
<NavMenu/>
</div>

<main>
<article class="content px-4">
@Body
</article>
</main>
</div>

<div id="blazor-error-ui" data-nosnippet>
An unhandled error has occurred.
<a href="." class="reload">Reload</a>
<span class="dismiss">🗙</span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}

main {
flex: 1;
}

.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}

.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}

.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
.top-row {
justify-content: space-between;
}

.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}

@media (min-width: 641px) {
.page {
flex-direction: row;
}

.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}

.top-row {
position: sticky;
top: 0;
z-index: 1;
}

.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}

.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}

#blazor-error-ui {
color-scheme: light only;
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
box-sizing: border-box;
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}

#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
23 changes: 23 additions & 0 deletions samples/MiniExcel.Samples.Blazor/Components/Layout/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">MiniExcel Blazor Demo</a>
</div>
</div>

<input type="checkbox" title="Navigation menu" class="navbar-toggler"/>

<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
<nav class="nav flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
</NavLink>
</div>

<div class="nav-item px-3">
<NavLink class="nav-link" href="upload">
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Upload
</NavLink>
</div>
</nav>
</div>
Loading
Loading