├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── question.md ├── release-drafter.yml └── workflows │ ├── ci-main.yml │ ├── ci-pr.yml │ └── release-drafter.yml ├── .gitignore ├── Blazored.Menu.sln ├── LICENSE ├── README.md ├── azure-pipelines.yml ├── samples ├── BlazorServerSide │ ├── App.razor │ ├── BlazorServerSide.csproj │ ├── Pages │ │ ├── Counter.razor │ │ ├── FetchData.razor │ │ ├── Index.razor │ │ └── _Host.cshtml │ ├── Program.cs │ ├── Services │ │ ├── WeatherForecast.cs │ │ └── WeatherForecastService.cs │ ├── Shared │ │ ├── MainLayout.razor │ │ └── NavMenu.razor │ ├── Startup.cs │ ├── _Imports.razor │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ ├── blazored-menu.css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ │ ├── css │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ └── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.svg │ │ │ │ ├── open-iconic.ttf │ │ │ │ └── open-iconic.woff │ │ └── site.css │ │ └── favicon.ico └── BlazorWebAssembly │ ├── App.razor │ ├── BlazorWebAssembly.csproj │ ├── Pages │ ├── Counter.razor │ ├── FetchData.razor │ └── Index.razor │ ├── Program.cs │ ├── Shared │ ├── MainLayout.razor │ └── NavMenu.razor │ ├── _Imports.razor │ └── wwwroot │ ├── .nojekyll │ ├── 404.html │ ├── css │ ├── bootstrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── open-iconic │ │ ├── FONT-LICENSE │ │ ├── ICON-LICENSE │ │ ├── README.md │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ └── site.css │ ├── favicon.ico │ ├── index.html │ ├── js │ └── decode.js │ └── sample-data │ └── weather.json ├── screenshot.png └── src └── Blazored.Menu ├── Blazored.Menu.csproj ├── BlazoredMenu.razor ├── BlazoredMenu.razor.cs ├── BlazoredMenuItem.razor ├── BlazoredMenuItem.razor.cs ├── BlazoredSubMenu.razor ├── BlazoredSubMenu.razor.cs ├── GlobalIconCss.cs ├── MenuBuilder.cs ├── icon.png └── wwwroot └── blazored-menu.css /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [chrissainty] 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[Bug]" 5 | labels: Bug, Triage 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Hosting Model (is this issue happening with a certain hosting model?):** 27 | - Blazor Server 28 | - Blazor WebAssembly 29 | - etc... 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[Feature Request]" 5 | labels: Feature Request, Triage 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question about this project 4 | title: "[Question]" 5 | labels: Question, Triage 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Please be sure to check the readme file before raising an issue.** 11 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: 'v$NEXT_PATCH_VERSION' 2 | tag-template: 'v$NEXT_PATCH_VERSION' 3 | template: | 4 | # What's Changed 5 | 6 | $CHANGES 7 | categories: 8 | - title: '🚀 Features' 9 | label: 'Feature' 10 | - title: '🐛 Bug Fixes' 11 | label: 'Bug' 12 | - title: '🧰 Maintenance' 13 | label: 'Maintenance' 14 | - title: '📖 Documentation' 15 | label: 'Docs' 16 | change-template: '- (#$NUMBER) $TITLE - Thanks to @$AUTHOR ' -------------------------------------------------------------------------------- /.github/workflows/ci-main.yml: -------------------------------------------------------------------------------- 1 | name: Build & Test Main 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | release: 7 | types: [ published ] 8 | 9 | env: 10 | NETCORE_VERSION: '5.0.102' 11 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true 12 | DOTNET_CLI_TELEMETRY_OPTOUT: true 13 | PROJECT_NAME: Menu 14 | GITHUB_FEED: https://nuget.pkg.github.com/Blazored/ 15 | GITHUB_USER: chrissainty 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | NUGET_FEED: https://api.nuget.org/v3/index.json 18 | NUGET_KEY: ${{ secrets.NUGET_KEY }} 19 | 20 | jobs: 21 | build: 22 | name: Build, test and pack 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v2 27 | 28 | - name: Setup .NET Core ${{ env.NETCORE_VERSION }} 29 | uses: actions/setup-dotnet@v1 30 | with: 31 | dotnet-version: ${{ env.NETCORE_VERSION }} 32 | env: 33 | NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} 34 | 35 | - name: Restore 36 | run: dotnet restore 37 | 38 | - name: Build 39 | run: dotnet build -c Release --no-restore src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.csproj 40 | 41 | - name: Test 42 | run: dotnet test -c Release 43 | 44 | - name: Pack 45 | run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.*proj 46 | 47 | - name: Publish Sample Site 48 | run: dotnet publish -c Release samples/BlazorWebAssembly/BlazorWebAssembly.csproj 49 | 50 | - name: Rewrite base href 51 | uses: SteveSandersonMS/ghaction-rewrite-base-href@v1 52 | with: 53 | html_path: samples/BlazorWebAssembly/bin/Release/netstandard2.1/publish/wwwroot/index.html 54 | base_href: /${{ env.PROJECT_NAME }}/ 55 | 56 | - name: Deploy to Github Pages 57 | uses: JamesIves/github-pages-deploy-action@releases/v3 58 | with: 59 | ACCESS_TOKEN: $GITHUB_TOKEN 60 | BASE_BRANCH: main # The branch the action should deploy from. 61 | BRANCH: gh-pages # The branch the action should deploy to. 62 | FOLDER: samples/BlazorWebAssembly/bin/Release/netstandard2.1/publish/wwwroot # The folder the action should deploy. 63 | SINGLE_COMMIT: true 64 | 65 | - name: Upload Artifact 66 | uses: actions/upload-artifact@v2 67 | with: 68 | name: nupkg 69 | path: ./src/Blazored.${{ env.PROJECT_NAME }}/bin/Release/*.nupkg 70 | prerelease: 71 | needs: build 72 | if: github.event_name != 'release' 73 | runs-on: ubuntu-latest 74 | steps: 75 | - name: Download Artifact 76 | uses: actions/download-artifact@v1 77 | with: 78 | name: nupkg 79 | - name: Push to GitHub Feed 80 | run: | 81 | for f in ./nupkg/*.nupkg 82 | do 83 | curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED 84 | done 85 | deploy: 86 | needs: build 87 | if: github.event_name == 'release' 88 | runs-on: ubuntu-latest 89 | steps: 90 | - uses: actions/checkout@v2 91 | - name: Setup .NET Core 92 | uses: actions/setup-dotnet@v1 93 | with: 94 | dotnet-version: ${{ env.NETCORE_VERSION }} 95 | - name: Create Release NuGet package 96 | run: | 97 | arrTag=(${GITHUB_REF//\// }) 98 | VERSION="${arrTag[2]}" 99 | echo Version: $VERSION 100 | VERSION="${VERSION//v}" 101 | echo Clean Version: $VERSION 102 | dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.*proj 103 | - name: Push to GitHub Feed 104 | run: | 105 | for f in ./nupkg/*.nupkg 106 | do 107 | curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED 108 | done 109 | - name: Push to NuGet Feed 110 | run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY 111 | -------------------------------------------------------------------------------- /.github/workflows/ci-pr.yml: -------------------------------------------------------------------------------- 1 | name: Build & Test PR 2 | 3 | on: 4 | pull_request: 5 | branches: [ main ] 6 | 7 | env: 8 | PROJECT_NAME: Blazored.Menu 9 | NETCORE_VERSION: '5.0.102' 10 | 11 | jobs: 12 | build: 13 | name: Build and test 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | 18 | - name: Setting up .NET Core SDK ${{ env.NETCORE_VERSION }}... 19 | uses: actions/setup-dotnet@v1 20 | with: 21 | dotnet-version: ${{ env.NETCORE_VERSION }} 22 | 23 | - name: Restoring packages... 24 | run: dotnet restore 25 | 26 | - name: Building project... 27 | run: dotnet build --configuration Release --no-restore src/$PROJECT_NAME/$PROJECT_NAME.csproj 28 | 29 | - name: Testing... 30 | run: dotnet test --no-restore --verbosity normal -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | update_release_draft: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: release-drafter/release-drafter@v5 13 | env: 14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /Blazored.Menu.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28705.295 5 | MinimumVisualStudioVersion = 15.0.26124.0 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazored.Menu", "src\Blazored.Menu\Blazored.Menu.csproj", "{2FAE0153-3327-4FF9-ABE9-405FB32C5411}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{62B26A1B-1131-4DF8-A45F-4ED5067895C8}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWebAssembly", "samples\BlazorWebAssembly\BlazorWebAssembly.csproj", "{C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorServerSide", "samples\BlazorServerSide\BlazorServerSide.csproj", "{B1FECB40-4770-4EC4-8F7D-29635C29B981}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3C7C49C3-7183-4962-B274-32A9AAB0DB67}" 15 | ProjectSection(SolutionItems) = preProject 16 | .github\workflows\ci-main.yml = .github\workflows\ci-main.yml 17 | .github\workflows\ci-pr.yml = .github\workflows\ci-pr.yml 18 | README.md = README.md 19 | .github\workflows\release-drafter.yml = .github\workflows\release-drafter.yml 20 | EndProjectSection 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|Any CPU = Debug|Any CPU 25 | Debug|x64 = Debug|x64 26 | Debug|x86 = Debug|x86 27 | Release|Any CPU = Release|Any CPU 28 | Release|x64 = Release|x64 29 | Release|x86 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Debug|x64.ActiveCfg = Debug|Any CPU 35 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Debug|x64.Build.0 = Debug|Any CPU 36 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Debug|x86.ActiveCfg = Debug|Any CPU 37 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Debug|x86.Build.0 = Debug|Any CPU 38 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Release|x64.ActiveCfg = Release|Any CPU 41 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Release|x64.Build.0 = Release|Any CPU 42 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Release|x86.ActiveCfg = Release|Any CPU 43 | {2FAE0153-3327-4FF9-ABE9-405FB32C5411}.Release|x86.Build.0 = Release|Any CPU 44 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Debug|x64.ActiveCfg = Debug|Any CPU 47 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Debug|x64.Build.0 = Debug|Any CPU 48 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Debug|x86.ActiveCfg = Debug|Any CPU 49 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Debug|x86.Build.0 = Debug|Any CPU 50 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Release|x64.ActiveCfg = Release|Any CPU 53 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Release|x64.Build.0 = Release|Any CPU 54 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Release|x86.ActiveCfg = Release|Any CPU 55 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6}.Release|x86.Build.0 = Release|Any CPU 56 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Debug|x64.ActiveCfg = Debug|Any CPU 59 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Debug|x64.Build.0 = Debug|Any CPU 60 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Debug|x86.ActiveCfg = Debug|Any CPU 61 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Debug|x86.Build.0 = Debug|Any CPU 62 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Release|Any CPU.ActiveCfg = Release|Any CPU 63 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Release|Any CPU.Build.0 = Release|Any CPU 64 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Release|x64.ActiveCfg = Release|Any CPU 65 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Release|x64.Build.0 = Release|Any CPU 66 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Release|x86.ActiveCfg = Release|Any CPU 67 | {B1FECB40-4770-4EC4-8F7D-29635C29B981}.Release|x86.Build.0 = Release|Any CPU 68 | EndGlobalSection 69 | GlobalSection(SolutionProperties) = preSolution 70 | HideSolutionNode = FALSE 71 | EndGlobalSection 72 | GlobalSection(NestedProjects) = preSolution 73 | {C6DA1922-2D23-4DC4-A3E7-74984A5C54B6} = {62B26A1B-1131-4DF8-A45F-4ED5067895C8} 74 | {B1FECB40-4770-4EC4-8F7D-29635C29B981} = {62B26A1B-1131-4DF8-A45F-4ED5067895C8} 75 | EndGlobalSection 76 | GlobalSection(ExtensibilityGlobals) = postSolution 77 | SolutionGuid = {10DFAA94-A34C-4C4B-B3E5-91D27F588965} 78 | EndGlobalSection 79 | EndGlobal 80 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Blazored 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Blazored Menu 2 | 3 | A JavaScript free menu library for Blazor and Razor Components applications. 4 | 5 | [![Build & Test Main](https://github.com/Blazored/Menu/actions/workflows/ci-main.yml/badge.svg)](https://github.com/Blazored/Menu/actions/workflows/ci-main.yml) 6 | 7 | [![Nuget](https://img.shields.io/nuget/v/blazored.menu.svg)](https://www.nuget.org/packages/Blazored.Menu/) 8 | 9 | ![Screenshot of component in action](screenshot.png) 10 | 11 | ## Getting Setup 12 | You can install the package via the nuget package manager just search for *Blazored.Menu*. You can also install via powershell using the following command. 13 | 14 | ```powershell 15 | Install-Package Blazored.Menu 16 | ``` 17 | 18 | Or via the dotnet CLI. 19 | 20 | ```bash 21 | dotnet add package Blazored.Menu 22 | ``` 23 | 24 | ### Add reference to style sheet 25 | Add the following line to the `head` tag of your `index.html` (Blazor WebAssembly App) or `_Host.cshtml` (Blazor Server app). 26 | 27 | ``` 28 | 29 | ``` 30 | 31 | ### Add Imports 32 | Add the following to your *_Imports.razor* 33 | 34 | ```csharp 35 | @using Blazored.Menu 36 | ``` 37 | 38 | ## Usage 39 | Blazored Menu allows menus to be built either using markup or dynamically, using the `MenuBuilder`. 40 | 41 | ### Building a menu with markup 42 | You can build your menus using the following components. 43 | 44 | - BlazoredMenu 45 | - BlazoredMenuItem 46 | - BlazoredSubMenu 47 | 48 | For example. 49 | 50 | ```html 51 | 52 | 53 | Home 54 | 55 | 56 | 57 | 58 | Counter 59 | 60 | 61 | 62 | 63 | Fetch data 64 | 65 | 66 | ``` 67 | 68 | You can also specify your own template for sub menu headers like so. 69 | 70 | ```html 71 | 72 | 73 | Home 74 | 75 | 76 | 77 | Sub Menu 78 | 79 | 80 | 81 | Counter 82 | 83 | 84 | Fetch data 85 | 86 | 87 | 88 | 89 | ``` 90 | 91 | _This feature is currently only available when building menus with markup._ 92 | 93 | You can also supply your own CSS classes to each of the 3 components 94 | - BlazoredMenu 95 | - BlazoredMenuItem 96 | - BlazoredSubMenu 97 | 98 | By setting the `Css` parameter. 99 | 100 | ```html 101 | 102 | 103 | Home 104 | 105 | 106 | 107 | Sub Menu 108 | 109 | 110 | 111 | Counter 112 | 113 | 114 | Fetch data 115 | 116 | 117 | 118 | 119 | ``` 120 | 121 | 122 | ### Building a menu dynamically using the MenuBuilder 123 | If you prefer you can use the `MenuBuilder` to create your menus using C#. The `MenuBuilder` exposes two methods `AddItem` and `AddSubMenu`. You can build the same menu from the markup example as follows. 124 | 125 | ```html 126 | 127 | 128 | @functions { 129 | MenuBuilder MenuBuilder = new MenuBuilder(); 130 | 131 | protected override void OnInit() 132 | { 133 | MenuBuilder.AddItem(1, "Home", "/") 134 | .AddSubMenu(2, "Sub Menu", new MenuBuilder().AddItem(1, "Counter", "counter") 135 | .AddItem(3, "FetchData", "fetchdata"); 136 | } 137 | } 138 | ``` 139 | 140 | ### MenuBuilder Options 141 | When using the `MenuBuilder` you have a couple of extra options available via the `AddItem` and `AddSubMenu` methods. 142 | 143 | - IsEnabled (default: true) 144 | - IsVisible (default: true) 145 | 146 | You can use these options to manipulate your menu items. `IsVisible`, if set to `false`, will mark your menu items as `display: none` making them invisible. Setting `IsEnabled` to `false` will render the item in a non-interactive state. 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | - master 3 | 4 | pool: 5 | vmImage: 'vs2017-win2016' 6 | 7 | variables: 8 | buildConfiguration: 'Release' 9 | 10 | steps: 11 | - task: DotNetCoreInstaller@0 12 | displayName: 'Installing .NET Core SDK...' 13 | inputs: 14 | version: 3.1.100-preview2-014569 15 | 16 | - task: NuGetToolInstaller@0 17 | displayName: 'Installing Nuget Tools...' 18 | inputs: 19 | versionSpec: '4.9.2' 20 | 21 | - script: dotnet build --configuration $(buildConfiguration) src/Blazored.Menu/Blazored.Menu.csproj 22 | displayName: 'Building $(buildConfiguration)...' 23 | 24 | - task: DotNetCoreCLI@2 25 | displayName: 'Generating Nuget Package... ' 26 | inputs: 27 | command: pack 28 | arguments: --no-build 29 | packagesToPack: src/Blazored.Menu/Blazored.Menu.csproj 30 | configuration: $(buildConfiguration) 31 | 32 | - task: PublishBuildArtifacts@1 33 | displayName: 'Publishing Build Artifacts...' 34 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |

Page not found

7 |

Sorry, but there's nothing here!

8 |
9 |
10 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/BlazorServerSide.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | 7.3 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | int currentCount = 0; 11 | 12 | void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @using BlazorServerSide.Services 3 | @inject WeatherForecastService ForecastService 4 | 5 |

Weather forecast

6 | 7 |

This component demonstrates fetching data from a service.

8 | 9 | @if (forecasts == null) 10 | { 11 |

Loading...

12 | } 13 | else 14 | { 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var forecast in forecasts) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
36 | } 37 | 38 | @code { 39 | WeatherForecast[] forecasts; 40 | 41 | protected override async Task OnInitializedAsync() 42 | { 43 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Samples of a multi-level submenu below: 6 | 7 |
8 | 9 | 10 | 11 |
12 | 13 | @**@ 14 | 15 |
16 | 17 | @code { 18 | MenuBuilder MenuBuilder1 = new MenuBuilder(); 19 | MenuBuilder MenuBuilder2 = new MenuBuilder(); 20 | 21 | protected override void OnInitialized() 22 | { 23 | MenuBuilder1 24 | .AddIconCssToClose("oi oi-chevron-top pt-3") 25 | .AddIconCssToOpen("oi oi-chevron-bottom pt-3") 26 | .AddItem(1, "Home", "/", match: NavLinkMatch.All) 27 | .AddItem(2, "Counter", "counter", isEnabled: false) 28 | .AddSubMenu(3, "Sub Menu sotto", new MenuBuilder() 29 | .AddItem(1, "Counter", "counter") 30 | .AddItem(2, "Fetch Data", "fetchdata", isEnabled: false) 31 | .AddItem(3, "You Can't See Me", "invisible", isVisible: false)) 32 | .AddSubMenu(4, "another sub menu", new MenuBuilder() 33 | .AddItem(1, "Counter", "counter") 34 | .AddItem(2, "Fetch Data", "fetchdata") 35 | .AddItem(3, "Paperino", "paperino") 36 | .AddSubMenu(4, "another subsubmenu", new MenuBuilder() 37 | .AddItem(1, "Counter", "counter"))) 38 | .AddItem(5, "FetchData", "fetchdata"); 39 | 40 | MenuBuilder2 41 | .AddIconCssToClose("oi oi-chevron-top pt-3") 42 | .AddIconCssToOpen("oi oi-chevron-bottom pt-3") 43 | .AddItem(1, "Home", "/", match: NavLinkMatch.All) 44 | .AddItem(2, "Counter", "counter", isEnabled: false) 45 | .AddSubMenu(3, "1st level submenu", new MenuBuilder() 46 | .AddItem(1, "Counter", "counter") 47 | .AddItem(2, "Fetch Data", "fetchdata", isEnabled: false) 48 | .AddItem(3, "You Can't See Me", "invisible", isVisible: false) 49 | .AddSubMenu(4, "2nd level submenu", new MenuBuilder() 50 | .AddItem(1, "Counter", "counter")) 51 | .AddSubMenu(2, "3rd level submenu", new MenuBuilder() 52 | .AddItem(1, "Counter", "counter") 53 | .AddSubMenu(2, "4th level submenu", new MenuBuilder() 54 | .AddItem(1, "Counter", "counter")))) 55 | .AddItem(4, "FetchData", "fetchdata"); 56 | } 57 | } -------------------------------------------------------------------------------- /samples/BlazorServerSide/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorServerSide.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | 5 | 6 | 7 | 8 | 9 | 10 | Blazored Menu - Blazor Server App 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | @(await Html.RenderComponentAsync(RenderMode.Server)) 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Hosting; 10 | using Microsoft.Extensions.Logging; 11 | 12 | namespace BlazorServerSide 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Services/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazorServerSide.Services 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF { get; set; } 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Services/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace BlazorServerSide.Services 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | var rng = new Random(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | Home 9 | 10 | 11 | Counter 12 | 13 | 14 | 15 | Sub Menu (Global icon) 16 | 17 | 18 | 19 | Counter 20 | 21 | 22 | Fetch data 23 | 24 | 25 | 26 | 29 | 30 | 31 | Counter 32 | 33 | 34 | Fetch data 35 | 36 | 37 | 38 | 39 | Fetch data 40 | 41 | 42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 | 50 | @code { 51 | MenuBuilder MenuBuilder = new MenuBuilder(); 52 | 53 | protected override void OnInitialized() 54 | { 55 | MenuBuilder 56 | .AddIconCssToClose("oi oi-chevron-top pt-3") 57 | .AddIconCssToOpen("oi oi-chevron-bottom pt-3") 58 | .AddItem(1, "Home", "/", match: NavLinkMatch.All) 59 | .AddItem(2, "Counter", "counter", isEnabled: false) 60 | .AddSubMenu(3, "Sub Menu", new MenuBuilder() 61 | .AddItem(1, "Counter", "counter") 62 | .AddItem(2, "Fetch Data", "fetchdata", isEnabled: false) 63 | .AddItem(3, "You Can't See Me", "invisible", isVisible: false)) 64 | .AddItem(4, "FetchData", "fetchdata"); 65 | } 66 | } -------------------------------------------------------------------------------- /samples/BlazorServerSide/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Hosting; 5 | using BlazorServerSide.Services; 6 | 7 | namespace BlazorServerSide 8 | { 9 | public class Startup 10 | { 11 | // This method gets called by the runtime. Use this method to add services to the container. 12 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 13 | public void ConfigureServices(IServiceCollection services) 14 | { 15 | services.AddRazorPages(); 16 | services.AddServerSideBlazor(); 17 | 18 | services.AddSingleton(); 19 | } 20 | 21 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 22 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 23 | { 24 | if (env.IsDevelopment()) 25 | { 26 | app.UseDeveloperExceptionPage(); 27 | } 28 | else 29 | { 30 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 31 | app.UseHsts(); 32 | } 33 | 34 | app.UseHttpsRedirection(); 35 | 36 | app.UseStaticFiles(); 37 | 38 | app.UseRouting(); 39 | 40 | app.UseEndpoints(endpoints => 41 | { 42 | endpoints.MapBlazorHub(); 43 | endpoints.MapFallbackToPage("/_Host"); 44 | }); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Components.Forms 3 | @using Microsoft.AspNetCore.Components.Routing 4 | @using Microsoft.AspNetCore.Components.Web 5 | @using Microsoft.JSInterop 6 | @using BlazorServerSide.Shared 7 | 8 | @using Blazored.Menu 9 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/blazored-menu.css: -------------------------------------------------------------------------------- 1 | .blazored-menu { 2 | list-style: none; 3 | padding: 1rem 0; 4 | } 5 | 6 | .blazored-menu li.hidden { 7 | display: none; 8 | } 9 | 10 | .blazored-menu li a { 11 | display: block; 12 | padding: .75rem 1rem; 13 | color: #e3e3e3; 14 | cursor: pointer; 15 | } 16 | 17 | .blazored-menu li a:hover { 18 | background: #555; 19 | color: #f5f5f5; 20 | } 21 | 22 | .blazored-menu li a.active { 23 | background: #777; 24 | color: #fff; 25 | } 26 | 27 | .blazored-menu .disabled { 28 | display: block; 29 | padding: .75rem 1rem; 30 | color: #999; 31 | cursor: not-allowed; 32 | background: #333; 33 | } 34 | 35 | .blazored-sub-menu-header { 36 | display: block; 37 | padding: .75rem 1rem; 38 | color: #fff; 39 | cursor: pointer; 40 | } 41 | 42 | .blazored-sub-menu-header:hover { 43 | background: #555; 44 | color: #f5f5f5; 45 | } 46 | 47 | .blazored-sub-menu-header span { 48 | display: block; 49 | position: relative; 50 | } 51 | 52 | .blazored-sub-menu-header span i { 53 | position: absolute; 54 | right: 0; 55 | } 56 | 57 | .blazored-sub-menu-header.open { 58 | background: #222; 59 | } 60 | 61 | .blazored-sub-menu-header.open span { 62 | padding-bottom: .75rem; 63 | } 64 | 65 | .blazored-sub-menu { 66 | display: none; 67 | padding: 0; 68 | list-style: none; 69 | } 70 | 71 | .blazored-sub-menu-header.open .blazored-sub-menu { 72 | display: block; 73 | } -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 9 | By P.J. Onori 10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) 11 | 12 | 13 | 14 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 74 | 76 | 79 | 81 | 84 | 86 | 88 | 91 | 93 | 95 | 98 | 100 | 102 | 104 | 106 | 109 | 112 | 115 | 117 | 121 | 123 | 125 | 127 | 130 | 132 | 134 | 136 | 138 | 141 | 143 | 145 | 147 | 149 | 151 | 153 | 155 | 157 | 159 | 162 | 165 | 167 | 169 | 172 | 174 | 177 | 179 | 181 | 183 | 185 | 189 | 191 | 194 | 196 | 198 | 200 | 202 | 205 | 207 | 209 | 211 | 213 | 215 | 218 | 220 | 222 | 224 | 226 | 228 | 230 | 232 | 234 | 236 | 238 | 241 | 243 | 245 | 247 | 249 | 251 | 253 | 256 | 259 | 261 | 263 | 265 | 267 | 269 | 272 | 274 | 276 | 280 | 282 | 285 | 287 | 289 | 292 | 295 | 298 | 300 | 302 | 304 | 306 | 309 | 312 | 314 | 316 | 318 | 320 | 322 | 324 | 326 | 330 | 334 | 338 | 340 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 358 | 360 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 379 | 381 | 383 | 386 | 388 | 390 | 392 | 394 | 396 | 399 | 401 | 404 | 406 | 408 | 410 | 412 | 414 | 416 | 419 | 421 | 423 | 425 | 428 | 431 | 435 | 438 | 440 | 442 | 444 | 446 | 448 | 451 | 453 | 455 | 457 | 460 | 462 | 464 | 466 | 468 | 471 | 473 | 477 | 479 | 481 | 483 | 486 | 488 | 490 | 492 | 494 | 496 | 499 | 501 | 504 | 506 | 509 | 512 | 515 | 517 | 520 | 522 | 524 | 526 | 529 | 532 | 534 | 536 | 539 | 542 | 543 | 544 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorServerSide/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | app { 8 | position: relative; 9 | display: flex; 10 | flex-direction: column; 11 | } 12 | 13 | .top-row { 14 | height: 3.5rem; 15 | display: flex; 16 | align-items: center; 17 | } 18 | 19 | .main { 20 | flex: 1; 21 | } 22 | 23 | .main .top-row { 24 | background-color: #e6e6e6; 25 | border-bottom: 1px solid #d6d5d5; 26 | } 27 | 28 | .sidebar .top-row { 29 | background-color: rgba(0,0,0,0.4); 30 | } 31 | 32 | .sidebar .navbar-brand { 33 | font-size: 1.1rem; 34 | } 35 | 36 | .sidebar .oi { 37 | width: 2rem; 38 | font-size: 1.1rem; 39 | vertical-align: text-top; 40 | top: -2px; 41 | } 42 | 43 | .nav-item { 44 | font-size: 0.9rem; 45 | padding-bottom: 0.5rem; 46 | } 47 | 48 | .nav-item:first-of-type { 49 | padding-top: 1rem; 50 | } 51 | 52 | .nav-item:last-of-type { 53 | padding-bottom: 1rem; 54 | } 55 | 56 | .nav-item a { 57 | color: #d7d7d7; 58 | border-radius: 4px; 59 | height: 3rem; 60 | display: flex; 61 | align-items: center; 62 | line-height: 3rem; 63 | } 64 | 65 | .nav-item a.active { 66 | background-color: rgba(255,255,255,0.25); 67 | color: white; 68 | } 69 | 70 | .nav-item a:hover { 71 | background-color: rgba(255,255,255,0.1); 72 | color: white; 73 | } 74 | 75 | .content { 76 | padding-top: 1.1rem; 77 | } 78 | 79 | .navbar-toggler { 80 | background-color: rgba(255, 255, 255, 0.1); 81 | } 82 | 83 | .valid.modified:not([type=checkbox]) { 84 | outline: 1px solid #26b050; 85 | } 86 | 87 | .invalid { 88 | outline: 1px solid red; 89 | } 90 | 91 | .validation-message { 92 | color: red; 93 | } 94 | 95 | @media (max-width: 767.98px) { 96 | .main .top-row { 97 | display: none; 98 | } 99 | } 100 | 101 | @media (min-width: 768px) { 102 | app { 103 | flex-direction: row; 104 | } 105 | 106 | .sidebar { 107 | width: 250px; 108 | height: 100vh; 109 | position: sticky; 110 | top: 0; 111 | } 112 | 113 | .main .top-row { 114 | position: sticky; 115 | top: 0; 116 | } 117 | 118 | .main > div { 119 | padding-left: 2rem !important; 120 | padding-right: 1.5rem !important; 121 | } 122 | 123 | .navbar-toggler { 124 | display: none; 125 | } 126 | 127 | .sidebar .collapse { 128 | /* Never collapse the sidebar for wide screens */ 129 | display: block; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /samples/BlazorServerSide/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorServerSide/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 |

Sorry, but there's nothing at this address

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/BlazorWebAssembly.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | 3.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | int currentCount = 0; 11 | 12 | void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @inject HttpClient Http 3 | 4 |

Weather forecast

5 | 6 |

This component demonstrates fetching data from the server.

7 | 8 | @if (forecasts == null) 9 | { 10 |

Loading...

11 | } 12 | else 13 | { 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | @foreach (var forecast in forecasts) 25 | { 26 | 27 | 28 | 29 | 30 | 31 | 32 | } 33 | 34 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
35 | } 36 | 37 | @code { 38 | WeatherForecast[] forecasts; 39 | 40 | protected override async Task OnInitializedAsync() 41 | { 42 | forecasts = await Http.GetFromJsonAsync("sample-data/weather.json"); 43 | } 44 | 45 | class WeatherForecast 46 | { 47 | public DateTime Date { get; set; } 48 | 49 | public int TemperatureC { get; set; } 50 | 51 | public int TemperatureF { get; set; } 52 | 53 | public string Summary { get; set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 |
8 | 9 |

Multi-sublevel menu sample:

10 | 11 | 12 | 13 | @code { 14 | MenuBuilder MenuBuilder = new MenuBuilder(); 15 | 16 | protected override void OnInitialized() 17 | { 18 | MenuBuilder 19 | .AddItem(1, "Home", "/", match: NavLinkMatch.All) 20 | .AddItem(2, "Counter", "counter", isEnabled: false) 21 | .AddSubMenu(3, "1st level submenu", new MenuBuilder() 22 | .AddItem(1, "Counter", "counter") 23 | .AddItem(2, "Fetch Data", "fetchdata", isEnabled: false) 24 | .AddItem(3, "You Can't See Me", "invisible", isVisible: false) 25 | .AddSubMenu(4, "2nd level submenu", new MenuBuilder() 26 | .AddItem(1, "Counter", "counter") 27 | .AddSubMenu(2, "3rd level submenu", new MenuBuilder() 28 | .AddItem(1, "Counter", "counter") 29 | .AddSubMenu(2, "4th level submenu", new MenuBuilder() 30 | .AddItem(1, "Counter", "counter"))))) 31 | .AddItem(4, "FetchData", "fetchdata") 32 | .AddIconCssToClose("oi oi-chevron-top pt-3") 33 | .AddIconCssToOpen("oi oi-chevron-bottom pt-3"); 34 | } 35 | } -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace BlazorWebAssembly 8 | { 9 | public class Program 10 | { 11 | public static async Task Main(string[] args) 12 | { 13 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 14 | builder.RootComponents.Add("app"); 15 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 16 | 17 | await builder.Build().RunAsync(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  4 | 5 | 7 | 8 | Home 9 | 10 | 11 | Counter 12 | 13 | 14 | 15 | Sub Menu (Global icon) 16 | 17 | 18 | 19 | Counter 20 | 21 | 22 | Fetch data 23 | 24 | 25 | 26 | 28 | 29 | Sub Menu 30 | 31 | 32 | 33 | Counter 34 | 35 | 36 | Fetch data 37 | 38 | 39 | 40 | 41 | Fetch data 42 | 43 | 44 | 45 | 46 | 47 | 48 | @code { 49 | MenuBuilder MenuBuilder = new MenuBuilder(); 50 | 51 | protected override void OnInitialized() 52 | { 53 | MenuBuilder.AddItem(1, "Home", "/", match: NavLinkMatch.All) 54 | .AddItem(2, "Counter", "counter", isEnabled: false) 55 | .AddSubMenu(3, "Sub Menu", new MenuBuilder().AddItem(1, "Counter", "counter") 56 | .AddItem(2, "Fetch Data", "fetchdata", isEnabled: false) 57 | .AddItem(3, "You Can't See Me", "invisible", isVisible: false)) 58 | .AddItem(4, "FetchData", "fetchdata") 59 | .AddIconCssToClose("oi oi-cloud-upload pt-3") 60 | .AddIconCssToOpen("oi oi-cloud-download pt-3") 61 | ; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Routing 4 | @using Microsoft.AspNetCore.Components.Web 5 | @using Microsoft.JSInterop 6 | @using BlazorWebAssembly 7 | @using BlazorWebAssembly.Shared 8 | 9 | @using Blazored.Menu 10 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/.nojekyll: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/404.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Single Page Apps for GitHub Pages 6 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | app { 8 | position: relative; 9 | display: flex; 10 | flex-direction: column; 11 | } 12 | 13 | .top-row { 14 | height: 3.5rem; 15 | display: flex; 16 | align-items: center; 17 | } 18 | 19 | .main { 20 | flex: 1; 21 | } 22 | 23 | .main .top-row { 24 | background-color: #e6e6e6; 25 | border-bottom: 1px solid #d6d5d5; 26 | } 27 | 28 | .sidebar .top-row { 29 | background-color: rgba(0,0,0,0.4); 30 | } 31 | 32 | .sidebar .navbar-brand { 33 | font-size: 1.1rem; 34 | } 35 | 36 | .sidebar .oi { 37 | width: 2rem; 38 | font-size: 1.1rem; 39 | vertical-align: text-top; 40 | top: -2px; 41 | } 42 | 43 | .nav-item { 44 | font-size: 0.9rem; 45 | padding-bottom: 0.5rem; 46 | } 47 | 48 | .nav-item:first-of-type { 49 | padding-top: 1rem; 50 | } 51 | 52 | .nav-item:last-of-type { 53 | padding-bottom: 1rem; 54 | } 55 | 56 | .nav-item a { 57 | color: #d7d7d7; 58 | border-radius: 4px; 59 | height: 3rem; 60 | display: flex; 61 | align-items: center; 62 | line-height: 3rem; 63 | } 64 | 65 | .nav-item a.active { 66 | background-color: rgba(255,255,255,0.25); 67 | color: white; 68 | } 69 | 70 | .nav-item a:hover { 71 | background-color: rgba(255,255,255,0.1); 72 | color: white; 73 | } 74 | 75 | .content { 76 | padding-top: 1.1rem; 77 | } 78 | 79 | .navbar-toggler { 80 | background-color: rgba(255, 255, 255, 0.1); 81 | } 82 | 83 | .valid.modified:not([type=checkbox]) { 84 | outline: 1px solid #26b050; 85 | } 86 | 87 | .invalid { 88 | outline: 1px solid red; 89 | } 90 | 91 | .validation-message { 92 | color: red; 93 | } 94 | 95 | @media (max-width: 767.98px) { 96 | .main .top-row { 97 | display: none; 98 | } 99 | } 100 | 101 | @media (min-width: 768px) { 102 | app { 103 | flex-direction: row; 104 | } 105 | 106 | .sidebar { 107 | width: 250px; 108 | height: 100vh; 109 | position: sticky; 110 | top: 0; 111 | } 112 | 113 | .main .top-row { 114 | position: sticky; 115 | top: 0; 116 | } 117 | 118 | .main > div { 119 | padding-left: 2rem !important; 120 | padding-right: 1.5rem !important; 121 | } 122 | 123 | .navbar-toggler { 124 | display: none; 125 | } 126 | 127 | .sidebar .collapse { 128 | /* Never collapse the sidebar for wide screens */ 129 | display: block; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/samples/BlazorWebAssembly/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Blazored Menu (Wasm) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 44 | 45 | 46 | 47 | 48 | Loading... 49 | 50 |
51 | An unhandled error has occurred. 52 | Reload 53 | 🗙 54 |
55 | 56 | 57 | 58 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/sample-data/weather.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2018-05-06", 4 | "temperatureC": 1, 5 | "summary": "Freezing", 6 | "temperatureF": 33 7 | }, 8 | { 9 | "date": "2018-05-07", 10 | "temperatureC": 14, 11 | "summary": "Bracing", 12 | "temperatureF": 57 13 | }, 14 | { 15 | "date": "2018-05-08", 16 | "temperatureC": -13, 17 | "summary": "Freezing", 18 | "temperatureF": 9 19 | }, 20 | { 21 | "date": "2018-05-09", 22 | "temperatureC": -16, 23 | "summary": "Balmy", 24 | "temperatureF": 4 25 | }, 26 | { 27 | "date": "2018-05-10", 28 | "temperatureC": -2, 29 | "summary": "Chilly", 30 | "temperatureF": 29 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/screenshot.png -------------------------------------------------------------------------------- /src/Blazored.Menu/Blazored.Menu.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | 3.0 6 | 7 | Chris Sainty 8 | 9 | Copyright 2020 (c) Chris Sainty. All rights reserved. 10 | 11 | A JavaScript free menu library for Blazor and Razor Components applications. 12 | true 13 | snupkg 14 | 15 | 16 | Blazored.Menu 17 | Blazored;Blazor;Razor;Components;Menu;ASP.NET Core;CSharp;Web 18 | MIT 19 | https://github.com/Blazored/Menu 20 | icon.png 21 | git 22 | https://github.com/Blazored/Menu 23 | 24 | 25 | true 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/Blazored.Menu/BlazoredMenu.razor: -------------------------------------------------------------------------------- 1 | @inherits BlazoredMenuBase 2 | 3 | 4 | @if (ChildContent != null) 5 | { 6 | 11 | } 12 | else 13 | { 14 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Blazored.Menu/BlazoredMenu.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using System; 3 | 4 | namespace Blazored.Menu 5 | { 6 | public class BlazoredMenuBase : ComponentBase 7 | { 8 | [Parameter] public RenderFragment ChildContent { get; set; } 9 | [Parameter] public MenuBuilder MenuBuilder { get; set; } 10 | [Parameter] public string Css { get; set; } 11 | [Parameter] public string IconClassToClose { get; set; } 12 | [Parameter] public string IconClassToOpen { get; set; } 13 | protected GlobalIconCss IconCss { get; set; } = new GlobalIconCss(); 14 | protected override void OnParametersSet() 15 | { 16 | if (ChildContent != null && MenuBuilder != null) 17 | { 18 | throw new InvalidOperationException($"Cannot use child content and menu builder together"); 19 | } 20 | var isOpenAvailable = string.IsNullOrEmpty(IconClassToOpen); 21 | var isCloseAvailble = string.IsNullOrEmpty(IconClassToClose); 22 | if (isOpenAvailable ^ isCloseAvailble) 23 | { 24 | throw new ArgumentException($"{nameof(IconClassToClose)} or {nameof(IconClassToOpen)} not specified"); 25 | } 26 | 27 | IconCss.IconClassToClose = IconClassToClose; 28 | IconCss.IconClassToOpen = IconClassToOpen; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Blazored.Menu/BlazoredMenuItem.razor: -------------------------------------------------------------------------------- 1 | @inherits BlazoredMenuItemBase 2 | @using Microsoft.AspNetCore.Components.Routing 3 | 4 | @if (ChildContent != null) 5 | { 6 |
  • 7 | @ChildContent 8 |
  • 9 | } 10 | else 11 | { 12 | if (IsEnabled) 13 | { 14 |
  • 15 | 16 | @MenuItem.Title 17 | 18 |
  • 19 | } 20 | else 21 | { 22 |
  • 23 | @MenuItem.Title 24 |
  • 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Blazored.Menu/BlazoredMenuItem.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace Blazored.Menu 4 | { 5 | public class BlazoredMenuItemBase : ComponentBase 6 | { 7 | [Parameter] public RenderFragment ChildContent { get; set; } 8 | [Parameter] public bool IsEnabled { get; set; } = true; 9 | [Parameter] public bool IsVisible { get; set; } = true; 10 | [Parameter] public string Css { get; set; } = string.Empty; 11 | [Parameter] public MenuItem MenuItem { get; set; } 12 | 13 | protected string CssString 14 | { 15 | get 16 | { 17 | var cssString = string.Empty; 18 | 19 | cssString += $"{Css}"; 20 | cssString += !IsEnabled ? " disabled" : ""; 21 | cssString += !IsVisible ? " hidden" : ""; 22 | 23 | return cssString.Trim(); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Blazored.Menu/BlazoredSubMenu.razor: -------------------------------------------------------------------------------- 1 | @inherits BlazoredSubMenuBase 2 | @using Microsoft.AspNetCore.Components.Web 3 | 4 |
  • 5 | @if (HeaderTemplate != null) 6 | { 7 | @HeaderTemplate @Icon 8 | } 9 | else 10 | { 11 | @Header @Icon 12 | } 13 | 14 |
      15 | @if (MenuTemplate != null) 16 | { 17 | @MenuTemplate 18 | } 19 | else 20 | { 21 | foreach (var item in MenuItems) 22 | { 23 | @if (item.IsSubMenu && item.IsVisible) 24 | { 25 | 30 | } 31 | else if (!item.IsSubMenu && item.IsVisible) 32 | { 33 | 34 | } 35 | } 36 | } 37 |
    38 |
  • -------------------------------------------------------------------------------- /src/Blazored.Menu/BlazoredSubMenu.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using Microsoft.AspNetCore.Components.Web; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace Blazored.Menu 7 | { 8 | public class BlazoredSubMenuBase : ComponentBase 9 | { 10 | [Parameter] public string Header { get; set; } 11 | [Parameter] public string IconClassToClose { get; set; } 12 | [Parameter] public string IconClassToOpen { get; set; } 13 | [Parameter] public RenderFragment ChildContent { get; set; } 14 | [Parameter] public RenderFragment HeaderTemplate { get; set; } 15 | [Parameter] public RenderFragment MenuTemplate { get; set; } 16 | [Parameter] public string Css { get; set; } 17 | [Parameter] public bool IsEnabled { get; set; } = true; 18 | [Parameter] public IEnumerable MenuItems { get; set; } = new List(); 19 | [CascadingParameter] public GlobalIconCss GlobalIconCss { get; set; } 20 | protected string Icon { get; set; } = "+"; 21 | protected bool IsOpen { get; set; } 22 | protected string IconCss { get; set; } 23 | 24 | private GlobalIconCss LocalIconCss { get; set; } = new GlobalIconCss(); 25 | 26 | protected bool SetUpDownIcon { get; set; } 27 | 28 | protected override void OnParametersSet() 29 | { 30 | base.OnParametersSet(); 31 | if (string.IsNullOrEmpty(IconClassToClose) && string.IsNullOrEmpty(IconClassToOpen)) 32 | { 33 | LocalIconCss = GlobalIconCss; // Takeover global definition 34 | } 35 | else 36 | { 37 | // Include local specified values 38 | LocalIconCss.IconClassToClose = IconClassToClose; 39 | LocalIconCss.IconClassToOpen = IconClassToOpen; 40 | } 41 | // Check if both are specified 42 | var isOpenAvailable = !string.IsNullOrEmpty(LocalIconCss.IconClassToOpen); 43 | var isCloseAvailable = !string.IsNullOrEmpty(LocalIconCss.IconClassToClose); 44 | if (!(isOpenAvailable && isCloseAvailable)) 45 | { 46 | throw new ArgumentException($"{nameof(IconClassToClose)} or {nameof(IconClassToOpen)} not specified"); 47 | } 48 | // If both are specified (We reach this if either none or both are specified either globally or at submenu 49 | if (isOpenAvailable && isCloseAvailable) 50 | { 51 | Icon = ""; 52 | IconCss = LocalIconCss.IconClassToOpen; 53 | SetUpDownIcon = true; 54 | } 55 | 56 | 57 | } 58 | protected string CssString 59 | { 60 | get 61 | { 62 | var cssString = "blazored-sub-menu-header"; 63 | 64 | cssString += $" {Css}"; 65 | cssString += IsOpen ? " open" : ""; 66 | 67 | return cssString.Trim(); 68 | } 69 | } 70 | 71 | protected void ToggleSubMenu() 72 | { 73 | IsOpen = !IsOpen; 74 | if (SetUpDownIcon) 75 | { 76 | IconCss = IsOpen ? LocalIconCss.IconClassToClose: LocalIconCss.IconClassToOpen; 77 | } 78 | else 79 | { 80 | Icon = IsOpen ? "-" : "+"; 81 | } 82 | } 83 | 84 | /// 85 | /// Handler for the key down events 86 | /// 87 | /// keyboard event 88 | protected void KeyDownHandler(KeyboardEventArgs eventArgs) 89 | { 90 | if (eventArgs.Key == "Enter" || eventArgs.Key == " " || eventArgs.Key == "Spacebar") 91 | { 92 | ToggleSubMenu(); 93 | } 94 | } 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/Blazored.Menu/GlobalIconCss.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Blazored.Menu 6 | { 7 | public class GlobalIconCss 8 | { 9 | public string IconClassToClose { get; set; } 10 | public string IconClassToOpen { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Blazored.Menu/MenuBuilder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Routing; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace Blazored.Menu 7 | { 8 | public class MenuBuilder 9 | { 10 | private List _menuItems; 11 | 12 | public MenuBuilder() 13 | { 14 | _menuItems = new List(); 15 | } 16 | private string CssToClose; 17 | private string CssToOpen; 18 | 19 | public MenuBuilder AddIconCssToClose(string closeCss) 20 | { 21 | CssToClose = closeCss; 22 | return this; 23 | } 24 | public MenuBuilder AddIconCssToOpen(string openCss) 25 | { 26 | CssToOpen = openCss; 27 | return this; 28 | } 29 | public MenuBuilder AddItem(int position, 30 | string title, 31 | string link, 32 | NavLinkMatch match = NavLinkMatch.Prefix, 33 | bool isVisible = true, 34 | bool isEnabled = true) 35 | { 36 | var menuItem = new MenuItem 37 | { 38 | Position = position, 39 | Title = title, 40 | Link = link, 41 | Match = match, 42 | IsSubMenu = false, 43 | IsVisible = isVisible, 44 | IsEnabled = isEnabled 45 | }; 46 | 47 | _menuItems.Add(menuItem); 48 | 49 | return this; 50 | } 51 | 52 | public MenuBuilder AddSubMenu(int position, 53 | string title, 54 | MenuBuilder menuItems, 55 | bool isVisible = true, 56 | bool isEnabled = true) 57 | { 58 | var menuItem = new MenuItem(); 59 | menuItem.Position = position; 60 | menuItem.IsSubMenu = true; 61 | menuItem.Title = title; 62 | menuItem.MenuItems = menuItems; 63 | menuItem.IsVisible = isVisible; 64 | menuItem.IsEnabled = isEnabled; 65 | menuItem.IconCssToClose = CssToClose; 66 | menuItem.IconCssToOpen = CssToOpen; 67 | 68 | _menuItems.Add(menuItem); 69 | return this; 70 | } 71 | 72 | internal List Build(Func orderBy) 73 | { 74 | var menuItems = _menuItems.OrderBy(orderBy).ToList(); 75 | menuItems.ForEach(m => 76 | { 77 | m.IconCssToClose = CssToClose; 78 | m.IconCssToOpen = CssToOpen; 79 | }); 80 | return menuItems.ToList(); 81 | } 82 | } 83 | 84 | public class MenuItem 85 | { 86 | public int Position { get; set; } 87 | public string Title { get; set; } 88 | public string Link { get; set; } 89 | public NavLinkMatch Match { get; set; } 90 | public MenuBuilder MenuItems { get; set; } 91 | public bool IsSubMenu { get; set; } 92 | public bool IsVisible { get; set; } 93 | public bool IsEnabled { get; set; } 94 | public string IconCssToOpen { get; set; } 95 | public string IconCssToClose { get; set; } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/Blazored.Menu/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazored/Menu/fbb55abc42180c057798fc182646dd8672d2e3ab/src/Blazored.Menu/icon.png -------------------------------------------------------------------------------- /src/Blazored.Menu/wwwroot/blazored-menu.css: -------------------------------------------------------------------------------- 1 | .blazored-menu { 2 | list-style: none; 3 | padding: 1rem 0; 4 | } 5 | 6 | .blazored-menu li.hidden { 7 | display: none; 8 | } 9 | 10 | .blazored-menu li a { 11 | display: block; 12 | padding: .75rem 1rem; 13 | color: #333; 14 | cursor: pointer; 15 | } 16 | 17 | .blazored-menu li a:hover { 18 | text-decoration: underline; 19 | } 20 | 21 | .blazored-menu li a.active { 22 | color: #333; 23 | } 24 | 25 | .blazored-menu .disabled { 26 | display: block; 27 | padding: .75rem 1rem; 28 | color: #d6d5d5; 29 | cursor: not-allowed; 30 | } 31 | 32 | .blazored-sub-menu-header { 33 | display: block; 34 | color: #333; 35 | cursor: pointer; 36 | } 37 | 38 | .blazored-sub-menu-header span:hover { 39 | text-decoration: underline; 40 | } 41 | 42 | .blazored-sub-menu-header span { 43 | display: block; 44 | padding: .75rem 1rem; 45 | position: relative; 46 | } 47 | 48 | .blazored-sub-menu-header span i { 49 | position: absolute; 50 | right: 0; 51 | } 52 | 53 | .blazored-sub-menu-header.open span { 54 | padding-bottom: .75rem; 55 | } 56 | 57 | .blazored-sub-menu-header > .blazored-sub-menu { 58 | display: none; 59 | padding: 0; 60 | margin-left: 1rem; 61 | list-style: none; 62 | } 63 | 64 | .blazored-sub-menu-header.open > .blazored-sub-menu { 65 | display: block; 66 | } 67 | --------------------------------------------------------------------------------