├── -.vs ├── Blazor-Calendar │ ├── DesignTimeBuild │ │ └── .dtbcache.v2 │ ├── FileContentIndex │ │ ├── 434cf658-3c3b-4ad1-b382-79b6c20635ca.vsidx │ │ ├── 4895e8f5-ce16-487c-8dc7-3906b28d3b7f.vsidx │ │ ├── ba42ea0c-73e9-4f10-a708-7dfdf58ca71f.vsidx │ │ ├── e7b87719-ade9-49c8-bedf-f91e6c8a1086.vsidx │ │ └── read.lock │ ├── config │ │ └── applicationhost.config │ └── v17 │ │ └── .futdcache.v1 ├── ProjectEvaluation │ ├── blazor-calendar.metadata.v2 │ └── blazor-calendar.projects.v2 ├── VSWorkspaceState.json └── slnx.sqlite ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── Blazor-Calendar.sln ├── BlazorCalendar ├── AnnualView.razor ├── AnnualView.razor.cs ├── Base │ └── CalendarBase.cs ├── BlazorCalendar.csproj ├── CalendarContainer.razor ├── CalendarContainer.razor.cs ├── Enums │ └── Enums.cs ├── Helpers │ └── Dates.cs ├── Models │ ├── CalendarEvents.cs │ ├── Tasks.cs │ └── taskPosition.cs ├── MonthlyView.razor ├── MonthlyView.razor.cs ├── MonthlyView.razor.css ├── Styles │ └── Colors.cs ├── WeekView.razor ├── WeekView.razor.cs ├── WeekView.razor.css ├── _Imports.razor ├── icon.png └── wwwroot │ └── BlazorCalendar.css ├── LICENSE ├── README.md └── samples ├── BlazorServer ├── App.razor ├── BlazorServer.csproj ├── Pages │ ├── Annualy.razor │ ├── Error.cshtml │ ├── Error.cshtml.cs │ ├── Monthly.razor │ ├── SwitchViews.razor │ ├── Weekly.razor │ ├── _Host.cshtml │ └── _Layout.cshtml ├── Program.cs ├── Properties │ └── launchSettings.json ├── Shared │ ├── MainLayout.razor │ ├── MainLayout.razor.css │ ├── NavMenu.razor │ └── NavMenu.razor.css ├── _Imports.razor ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── 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 ├── Annualy.razor ├── Monthly.razor ├── SwitchViews.razor └── Weekly.razor ├── Program.cs ├── Properties └── launchSettings.json ├── Shared ├── MainLayout.razor ├── MainLayout.razor.css ├── NavMenu.razor └── NavMenu.razor.css ├── _Imports.razor └── wwwroot ├── css ├── app.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 ├── favicon.ico ├── icon-192.png └── index.html /-.vs/Blazor-Calendar/DesignTimeBuild/.dtbcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/Blazor-Calendar/DesignTimeBuild/.dtbcache.v2 -------------------------------------------------------------------------------- /-.vs/Blazor-Calendar/FileContentIndex/434cf658-3c3b-4ad1-b382-79b6c20635ca.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/Blazor-Calendar/FileContentIndex/434cf658-3c3b-4ad1-b382-79b6c20635ca.vsidx -------------------------------------------------------------------------------- /-.vs/Blazor-Calendar/FileContentIndex/4895e8f5-ce16-487c-8dc7-3906b28d3b7f.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/Blazor-Calendar/FileContentIndex/4895e8f5-ce16-487c-8dc7-3906b28d3b7f.vsidx -------------------------------------------------------------------------------- /-.vs/Blazor-Calendar/FileContentIndex/ba42ea0c-73e9-4f10-a708-7dfdf58ca71f.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/Blazor-Calendar/FileContentIndex/ba42ea0c-73e9-4f10-a708-7dfdf58ca71f.vsidx -------------------------------------------------------------------------------- /-.vs/Blazor-Calendar/FileContentIndex/e7b87719-ade9-49c8-bedf-f91e6c8a1086.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/Blazor-Calendar/FileContentIndex/e7b87719-ade9-49c8-bedf-f91e6c8a1086.vsidx -------------------------------------------------------------------------------- /-.vs/Blazor-Calendar/FileContentIndex/read.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/Blazor-Calendar/FileContentIndex/read.lock -------------------------------------------------------------------------------- /-.vs/Blazor-Calendar/v17/.futdcache.v1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/Blazor-Calendar/v17/.futdcache.v1 -------------------------------------------------------------------------------- /-.vs/ProjectEvaluation/blazor-calendar.metadata.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/ProjectEvaluation/blazor-calendar.metadata.v2 -------------------------------------------------------------------------------- /-.vs/ProjectEvaluation/blazor-calendar.projects.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/ProjectEvaluation/blazor-calendar.projects.v2 -------------------------------------------------------------------------------- /-.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "SelectedNode": "\\Blazor-Calendar.sln", 6 | "PreviewInSolutionExplorer": false 7 | } -------------------------------------------------------------------------------- /-.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/-.vs/slnx.sqlite -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: 'Publish application' 2 | on: push 3 | 4 | jobs: 5 | build: 6 | if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') 7 | runs-on: ubuntu-latest 8 | 9 | env: 10 | PUBLISH_FOLDER: samples/BlazorWebAssembly/bin/Release/net9.0/publish/wwwroot 11 | 12 | name: Build and Deploy Job 13 | steps: 14 | - name: Set the name of the repo in env variable 15 | run: 16 | echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV 17 | 18 | - uses: actions/checkout@v2 19 | 20 | - uses: actions/setup-dotnet@v3 21 | with: 22 | dotnet-version: '9.x' 23 | 24 | - name: Dotnet Publish 25 | run: 26 | dotnet publish --configuration Release -f net9.0 27 | 28 | - name: Change base-tag in index.html to repo name 29 | run: sed -i 's///g' $GITHUB_WORKSPACE/$PUBLISH_FOLDER/index.html 30 | 31 | - name: copy index.html to 404.html 32 | run: cp $GITHUB_WORKSPACE/$PUBLISH_FOLDER/index.html $GITHUB_WORKSPACE/$PUBLISH_FOLDER/404.html 33 | 34 | - name: Add .nojekyll file 35 | run: touch $PUBLISH_FOLDER/.nojekyll 36 | 37 | - name: Deploy GitHub Pages action 38 | if: ${{ github.ref == 'refs/heads/main' }} 39 | uses: peaceiris/actions-gh-pages@v3.6.1 40 | with: 41 | github_token: ${{ secrets.PUBLISH_TOKEN }} 42 | publish_branch: gh-pages 43 | publish_dir: /${{ env.PUBLISH_FOLDER }} 44 | allow_empty_commit: false 45 | keep_files: false 46 | force_orphan: true 47 | -------------------------------------------------------------------------------- /.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 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /Blazor-Calendar.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31710.8 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorCalendar", "BlazorCalendar\BlazorCalendar.csproj", "{D018189F-E4BE-4693-9BF0-FE8325CB0899}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{9A175C09-D84D-4734-9E6E-00C89C09AA2A}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorServer", "samples\BlazorServer\BlazorServer.csproj", "{C61DD137-FEBF-4644-8098-EC4263AF3967}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWebAssembly", "samples\BlazorWebAssembly\BlazorWebAssembly.csproj", "{5D3171BB-C17D-462D-AECE-3C8DEAC85441}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {D018189F-E4BE-4693-9BF0-FE8325CB0899}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {D018189F-E4BE-4693-9BF0-FE8325CB0899}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {D018189F-E4BE-4693-9BF0-FE8325CB0899}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {D018189F-E4BE-4693-9BF0-FE8325CB0899}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {C61DD137-FEBF-4644-8098-EC4263AF3967}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {C61DD137-FEBF-4644-8098-EC4263AF3967}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {C61DD137-FEBF-4644-8098-EC4263AF3967}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {C61DD137-FEBF-4644-8098-EC4263AF3967}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {5D3171BB-C17D-462D-AECE-3C8DEAC85441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {5D3171BB-C17D-462D-AECE-3C8DEAC85441}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {5D3171BB-C17D-462D-AECE-3C8DEAC85441}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {5D3171BB-C17D-462D-AECE-3C8DEAC85441}.Release|Any CPU.Build.0 = Release|Any CPU 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | GlobalSection(NestedProjects) = preSolution 37 | {C61DD137-FEBF-4644-8098-EC4263AF3967} = {9A175C09-D84D-4734-9E6E-00C89C09AA2A} 38 | {5D3171BB-C17D-462D-AECE-3C8DEAC85441} = {9A175C09-D84D-4734-9E6E-00C89C09AA2A} 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {B68E7280-0A03-4BD1-B3B5-AB2A9B68195D} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /BlazorCalendar/AnnualView.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCalendar.Models 2 | @using BlazorCalendar.Styles 3 | 4 | @inherits CalendarBase 5 | 6 | @{ 7 | string labelMonth = string.Empty; 8 | string labelDay = string.Empty; 9 | string? CSSbackground; 10 | string taskContent = string.Empty; 11 | string? taskColor; 12 | string? taskComment; 13 | string? classPin; 14 | string? classPointer; 15 | int tasksCounter; 16 | bool draggable = false; 17 | string? ondragover; 18 | string? disabled; 19 | string? isHidden = DisplayedView == DisplayedView.Annual ? null : "hidden-element"; 20 | bool NotbeDraggeble = false; 21 | string borderStyle = string.Empty; 22 | } 23 |
24 | 25 |
26 | 27 | @for (var month = 0; month <= Months; month++) 28 | { 29 | m = FirstDate.AddMonths(month); 30 | var day = new DateTime(m.Year, m.Month, 1); 31 | labelMonth = day.ToString("MMMM"); 32 | 33 |
34 |
35 | @labelMonth 36 |
37 | 38 | @for (var i = 0; i < 31; i++) 39 | { 40 | CSSbackground = null; 41 | var j = day.AddDays(i); 42 | int taskID = -1; 43 | if (j.Month != m.Month) 44 | { 45 | j = default; 46 | labelDay = string.Empty; 47 | taskContent = string.Empty; 48 | taskColor = null; 49 | taskComment = null; 50 | classPin = null; 51 | classPointer = null; 52 | draggable = false; 53 | ondragover = null; 54 | taskID = -1; 55 | disabled = "cellule-disabled"; 56 | CSSbackground = null; 57 | } 58 | else 59 | { 60 | disabled = null; 61 | CSSbackground = GetBackground(j); 62 | 63 | string jour = j.ToString("ddd").Substring(0, 1).ToUpper(); 64 | labelDay = $"{jour} {j.Day.ToString()}"; 65 | 66 | taskContent = string.Empty; 67 | taskColor = null; 68 | taskComment = null; 69 | classPin = null; 70 | classPointer = null; 71 | tasksCounter = 0; 72 | ondragover = "event.preventDefault();"; 73 | borderStyle = string.Empty; 74 | if ( TasksList is not null ) 75 | { 76 | for (var k = 0; k < TasksList.Length; k++) 77 | { 78 | Tasks t = TasksList[k]; 79 | 80 | if ( t.DateStart.Date <= j.Date && j.Date <= t.DateEnd.Date ) 81 | { 82 | taskID = t.ID; 83 | tasksCounter++; 84 | if ( PriorityDisplay == PriorityLabel.Code ) 85 | { 86 | taskContent = string.IsNullOrWhiteSpace(t.Code) ? t.Caption : t.Code; 87 | } 88 | else 89 | { 90 | taskContent = string.IsNullOrWhiteSpace(t.Caption) ? t.Code : t.Caption; 91 | } 92 | 93 | taskColor = Colors.GetHatching(t.FillStyle, t.Color); 94 | taskColor = $"{taskColor};color:{t.ForeColor}"; 95 | 96 | taskComment = t.Comment; 97 | classPin = string.IsNullOrWhiteSpace(t.Comment) ? null : " pin"; 98 | classPointer = " cursor-pointer"; 99 | NotbeDraggeble = t.NotBeDraggable; 100 | 101 | if (t.DateStart.Date == j.Date && t.DateEnd.Date != j.Date) 102 | borderStyle = "border-top"; 103 | else if (t.DateEnd.Date == j.Date && t.DateStart.Date != j.Date) 104 | borderStyle = "border-bottom"; 105 | else if (t.DateEnd.Date == j.Date && t.DateStart.Date == j.Date) 106 | borderStyle = "border-top border-bottom"; 107 | } 108 | } 109 | } 110 | if ( tasksCounter > 1 ) 111 | { 112 | taskContent = "…"; 113 | taskComment = null; 114 | taskColor = null; 115 | classPin = " pin-top"; 116 | draggable = false; 117 | taskID = -1; 118 | } 119 | else if ( tasksCounter == 1 ) 120 | { 121 | draggable = Draggable != true ? false : true; 122 | if (NotbeDraggeble == true ) draggable = false; 123 | } 124 | } 125 | 126 |
131 |
132 | @labelDay 133 |
134 |
141 | @taskContent 142 |
143 |
144 | } 145 |
146 | } 147 | 148 |
149 |
-------------------------------------------------------------------------------- /BlazorCalendar/AnnualView.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCalendar.Models; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.AspNetCore.Components.Web; 4 | 5 | namespace BlazorCalendar; 6 | 7 | partial class AnnualView : CalendarBase 8 | { 9 | [CascadingParameter(Name = "SelectedView")] 10 | public DisplayedView DisplayedView { get; set; } = DisplayedView.Annual; 11 | 12 | private int _months = 11; 13 | [Parameter] 14 | public int Months 15 | { 16 | get 17 | { 18 | return _months; 19 | } 20 | set 21 | { 22 | _months = value; 23 | if (_months > 1) _months--; 24 | } 25 | } 26 | 27 | private DateTime _firstdate; 28 | [CascadingParameter(Name = "FirstDate")] 29 | public DateTime FirstDate 30 | { 31 | get 32 | { 33 | if (_firstdate == DateTime.MinValue) _firstdate = DateTime.Today; 34 | return _firstdate.Date; 35 | } 36 | set 37 | { 38 | _firstdate = value; 39 | } 40 | } 41 | 42 | [CascadingParameter(Name = "TasksList")] 43 | public Tasks[]? TasksList { get; set; } 44 | 45 | 46 | [Parameter] 47 | public PriorityLabel PriorityDisplay { get; set; } = PriorityLabel.Code; 48 | 49 | [Parameter] 50 | public EventCallback TaskClick { get; set; } 51 | 52 | [Parameter] 53 | public EventCallback EmptyDayClick { get; set; } 54 | 55 | [Parameter] 56 | public EventCallback DragStart { get; set; } 57 | 58 | [Parameter] 59 | public EventCallback DropTask { get; set; } 60 | 61 | [Parameter] 62 | public EventCallback HeaderClick { get; set; } 63 | 64 | private DateTime m = DateTime.Today; 65 | private Tasks? TaskDragged; 66 | 67 | private async Task ClickInternal(MouseEventArgs e, DateTime day) 68 | { 69 | if (day == default) 70 | return; 71 | 72 | // There can be several tasks in one day : 73 | List listID = new(); 74 | 75 | if (TasksList is not null ) 76 | { 77 | for (var k = 0; k < TasksList.Length; k++) 78 | { 79 | Tasks t = TasksList[k]; 80 | 81 | if (t.DateStart.Date <= day.Date && day.Date <= t.DateEnd.Date) 82 | { 83 | listID.Add(t.ID); 84 | } 85 | } 86 | } 87 | 88 | if (listID.Any()) 89 | { 90 | if (TaskClick.HasDelegate) 91 | { 92 | ClickTaskParameter clickTaskParameter = new() 93 | { 94 | IDList = listID, 95 | X = e.ClientX, 96 | Y = e.ClientY, 97 | Day = day 98 | }; 99 | 100 | await TaskClick.InvokeAsync(clickTaskParameter); 101 | } 102 | } 103 | else 104 | { 105 | if (EmptyDayClick.HasDelegate) 106 | { 107 | 108 | ClickEmptyDayParameter clickEmptyDayParameter = new() 109 | { 110 | Day = day, 111 | X = e.ClientX, 112 | Y = e.ClientY 113 | }; 114 | 115 | await EmptyDayClick.InvokeAsync(clickEmptyDayParameter); 116 | } 117 | } 118 | } 119 | 120 | private async Task HandleDragStart(DateTime day, int taskID) 121 | { 122 | if (taskID < 0) 123 | return; 124 | 125 | TaskDragged = new Tasks() 126 | { 127 | ID = taskID 128 | }; 129 | 130 | DragDropParameter dragDropParameter = new() 131 | { 132 | Day = day, 133 | taskID = TaskDragged.ID 134 | }; 135 | 136 | await DragStart.InvokeAsync(dragDropParameter); 137 | } 138 | 139 | private async Task HandleDayOnDrop(DateTime day) 140 | { 141 | if (TaskDragged is null) 142 | return; 143 | 144 | DragDropParameter dragDropParameter = new() 145 | { 146 | Day = day, 147 | taskID = TaskDragged.ID 148 | }; 149 | 150 | await DropTask.InvokeAsync(dragDropParameter); 151 | 152 | TaskDragged = null; 153 | } 154 | 155 | private async Task HandleHeaderClick(DateTime month) 156 | { 157 | if (!HeaderClick.HasDelegate) 158 | return; 159 | 160 | await HeaderClick.InvokeAsync(month); 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /BlazorCalendar/Base/CalendarBase.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorCalendar; 4 | 5 | public abstract class CalendarBase : ComponentBase 6 | { 7 | /// 8 | /// User class names, separated by space. Applied on top of the component's own classes 9 | /// 10 | [Parameter] 11 | public string Class { get; set; } 12 | 13 | /// 14 | /// User styles, applied on top of the component's own styles. 15 | /// 16 | [Parameter] 17 | public string Style { get; set; } 18 | 19 | /// 20 | /// User styles of column headers, applied on top of the component's own styles. 21 | /// 22 | [Parameter] 23 | public string HeaderStyle { get; set; } 24 | 25 | /// 26 | /// Allows the user to move the tasks 27 | /// 28 | [Parameter] 29 | public bool Draggable { get; set; } = false; 30 | 31 | /// 32 | /// Allows the user to change the background color of empty days 33 | /// 34 | [Parameter] 35 | public string WeekDaysColor { get; set; } = "#FFF"; 36 | 37 | /// 38 | /// Allows the user to change the saturday background color 39 | /// 40 | [Parameter] 41 | public string SaturdayColor { get; set; } = "#ECF4FD"; 42 | 43 | /// 44 | /// Allows the user to change the sunday background color 45 | /// 46 | [Parameter] 47 | public string SundayColor { get; set; } = "#DBE7F8"; 48 | 49 | /// 50 | /// Allows the user to change the sunday background color 51 | /// 52 | [Parameter] 53 | public string DisabledDayColor { get; set; } = "#DBE7F8"; 54 | 55 | public string GetBackground(DateTime day) 56 | { 57 | int d = (int)day.DayOfWeek; 58 | 59 | if (d == 6) 60 | { 61 | return $"background:{SaturdayColor}"; 62 | } 63 | else if (d == 0) 64 | { 65 | return $"background:{SundayColor}"; 66 | } 67 | 68 | return $"background:{WeekDaysColor}"; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /BlazorCalendar/BlazorCalendar.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0; net8.0;net9.0 5 | enable 6 | enable 7 | True 8 | Yearly, monthly and weekly calendar Blazor Component. For use with .NET 7.0 or higher Blazor applications 9 | Copyright 2024 10 | https://github.com/tossnet/Blazor-Calendar 11 | icon.png 12 | https://github.com/tossnet/Blazor-Calendar 13 | git 14 | blazor, calendar, schedule, component 15 | https://github.com/tossnet/Blazor-Calendar#release-notes 16 | 2.7.1 17 | Christophe Peugnet 18 | embedded 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /BlazorCalendar/CalendarContainer.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCalendar.Models 2 | @inherits CalendarBase 3 | 4 | 5 | 6 | 7 | @ChildContent 8 | 9 | 10 | 11 | 12 | @code { 13 | [Parameter] 14 | public RenderFragment ChildContent { get; set; } 15 | 16 | [Parameter] 17 | public DateTime FirstDate { get; set; } 18 | 19 | [Parameter] 20 | public DisplayedView DisplayedView { get; set; } 21 | 22 | [Parameter] 23 | public Tasks[]? TasksList { get; set; } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /BlazorCalendar/CalendarContainer.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar; 2 | 3 | partial class CalendarContainer : CalendarBase 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /BlazorCalendar/Enums/Enums.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar; 2 | 3 | using System.ComponentModel; 4 | 5 | public enum PriorityLabel 6 | { 7 | Code = 0, 8 | Caption = 1 9 | } 10 | 11 | public enum DisplayedView 12 | { 13 | Annual = 0, 14 | Monthly = 1, 15 | Weekly = 2 16 | } 17 | 18 | public enum FillStyleEnum 19 | { 20 | [Description("fill")] 21 | Fill = 0, 22 | [Description("backwardDiagonal")] 23 | BackwardDiagonal = 1, 24 | [Description("zigZag")] 25 | ZigZag = 2, 26 | [Description("triangles")] 27 | Triangles = 3, 28 | [Description("crossDots")] 29 | CrossDots = 4 30 | } -------------------------------------------------------------------------------- /BlazorCalendar/Helpers/Dates.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar; 2 | 3 | using System.Globalization; 4 | 5 | internal sealed class Dates 6 | { 7 | internal static int GetNumOfDay(int numOfDay) 8 | { 9 | // The order of the days of the week is different in each country 10 | // DayOfWeek : 11 | // .Sunday = 0 12 | // .Monday = 1 13 | // .Tuesday = 2 14 | // .Wednesday = 3 15 | // .Thursday = 4 16 | // .Friday = 5 17 | // .Saturday = 6 18 | // 19 | // => if Sunday is the First Day => 0 1 2 3 4 5 6 20 | // => if Monday is the First Day => 1 2 3 4 5 6 0 21 | // => if Saturday is the First Day => 6 0 1 2 3 4 5 22 | 23 | // To test : 24 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("dz-DZ"); // firstDayOfWeek = Saturday 25 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fr-FR"); // firstDayOfWeek = Monday 26 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); // firstDayOfWeek = Sunday 27 | 28 | if (numOfDay < 0) return 0; 29 | if (numOfDay > 6) 30 | { 31 | // Whatever the value I transform it in the place from 0 to 6 32 | numOfDay %= 7; 33 | } 34 | 35 | var firstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; 36 | 37 | if (firstDayOfWeek == DayOfWeek.Saturday) 38 | { 39 | if (numOfDay == 0) numOfDay = 6; 40 | if (numOfDay == 7) numOfDay = 0; 41 | } 42 | else if (firstDayOfWeek == DayOfWeek.Monday) 43 | { 44 | if (numOfDay >= 0) numOfDay++; 45 | if (numOfDay == 7) numOfDay = 0; 46 | } 47 | 48 | return numOfDay; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /BlazorCalendar/Models/CalendarEvents.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar.Models; 2 | 3 | public class ClickTaskParameter 4 | { 5 | public List IDList { get; set; } 6 | public double X { get; set; } 7 | public double Y { get; set; } 8 | public DateTime Day { get; set; } 9 | } 10 | 11 | public class ClickEmptyDayParameter 12 | { 13 | public DateTime Day { get; set; } 14 | public double X { get; set; } 15 | public double Y { get; set; } 16 | } 17 | 18 | public class DragDropParameter 19 | { 20 | public DateTime Day { get; set; } 21 | public int taskID { get; set; } 22 | } -------------------------------------------------------------------------------- /BlazorCalendar/Models/Tasks.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar.Models; 2 | 3 | using System.Diagnostics; 4 | 5 | [DebuggerDisplay("{ID} {Code} {DateStart}")] 6 | public sealed class Tasks 7 | { 8 | public int ID { get; set; } 9 | public string? Key { get; set; } 10 | public string Caption { get; set; } 11 | public string Code { get; set; } 12 | public string Color { get; set; } 13 | public string? ForeColor { get; set; } = null; 14 | public FillStyleEnum FillStyle { get; set; } 15 | public string? Comment { get; set; } = null; 16 | public DateTime DateStart { get; set; } 17 | public DateTime DateEnd { get; set; } 18 | public bool NotBeDraggable { get; set; } 19 | public int Type { get; set; } 20 | } 21 | -------------------------------------------------------------------------------- /BlazorCalendar/Models/taskPosition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar; 2 | 3 | internal sealed class TaskPosition 4 | { 5 | public int Counter { get; set; } 6 | public bool Top { get; set; } 7 | public bool Center { get; set; } 8 | public bool Bottom { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /BlazorCalendar/MonthlyView.razor: -------------------------------------------------------------------------------- 1 | @using System.Globalization 2 | @using BlazorCalendar.Models 3 | @using BlazorCalendar.Styles 4 | 5 | @inherits CalendarBase 6 | 7 | @{ 8 | FirstDate = new DateTime(FirstDate.Year, FirstDate.Month, 1); 9 | int firstDayWeek = (int)FirstDate.DayOfWeek; 10 | 11 | StateCase State = StateCase.Before; 12 | DateTime LastDay = new DateTime(FirstDate.Year, FirstDate.Month, 1).AddMonths(1); 13 | DateTime DayCounter = FirstDate; 14 | DateTime Today = DateTime.Today; 15 | string[] dayNames = CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedDayNames; 16 | int OffsetCell = 0; 17 | string? isHidden = DisplayedView == DisplayedView.Monthly ? null : "hidden-element"; 18 | string? CSSbackground = null; 19 | string? CSSToday = null; 20 | 21 | // The sorting must be done each time we redraw in case the user moves the spots 22 | if (TasksList is not null) 23 | { 24 | TasksList = TasksList.OrderBy(x => x.DateStart) 25 | .ThenByDescending(x => x.DateEnd) 26 | .ToArray(); 27 | } 28 | } 29 | 30 |
31 | 32 | @for (var i = 0; i < 7; i++) 33 | { 34 | var d = Dates.GetNumOfDay(i); 35 | 36 | 37 | @dayNames[d] 38 | 39 | } 40 | 41 | @for ( var i = 0; i < 40; i++ ) 42 | { 43 | if (State == StateCase.Before) 44 | { 45 | if (firstDayWeek == Dates.GetNumOfDay(i)) // Cell is first day? 46 | { 47 | State = StateCase.InMonth; // Start filling days 48 | var dayClick = DayCounter; 49 | CSSbackground = GetBackground(dayClick); 50 |
55 | @(DayCounter.Day.ToString()) 56 |
57 | DayCounter = DayCounter.AddDays(1); 58 | OffsetCell = i; 59 | } 60 | else 61 | { 62 | // Still empty cells 63 |
65 |
66 | } 67 | } 68 | if (State == StateCase.InMonth) 69 | { 70 | if (DayCounter >= LastDay) // Stop at last day 71 | { 72 | State = StateCase.After; 73 | // Again empty cells from here on 74 |
76 |
77 | } 78 | else 79 | { 80 | DateTime _dayClick = DayCounter; 81 | CSSbackground = GetBackground(_dayClick); 82 | if (HighlightToday) 83 | { 84 | CSSToday = DayCounter == Today ? "monthly-today" : null; 85 | } 86 | 87 |
92 | @(DayCounter.Day.ToString()) 93 |
94 | DayCounter = DayCounter.AddDays(1); 95 | } 96 | } 97 | if (State == StateCase.After) 98 | { 99 |
101 |
102 | } 103 | } 104 | 105 | @if ( TasksList is not null ) 106 | { 107 | // occupiedPosition accumulates the number of tasks in a cell 108 | var occupiedPosition = new TaskPosition[32]; // If one day, there are 32 days in a month, it will crash :P 109 | for (int i = 0; i < 32; ++i) 110 | { 111 | occupiedPosition[i] = new TaskPosition(); 112 | } 113 | 114 | string? classPosition; 115 | string taskContent = string.Empty; 116 | string? taskComment = null; 117 | bool onmMultiLine = false; 118 | bool draggable = false; 119 | 120 | for (var k = 0; k < TasksList.Length; k++) 121 | { 122 | Tasks t = TasksList[k]; 123 | 124 | if (( t.DateStart.Date <= FirstDate && FirstDate <= t.DateEnd.Date ) || 125 | ( t.DateStart.Date > FirstDate && LastDay > t.DateEnd.Date ) || 126 | ( t.DateStart.Date < LastDay && LastDay <= t.DateEnd.Date )) 127 | { 128 | draggable = t.NotBeDraggable ? false : Draggable; 129 | 130 | // Reframes dates in the month 131 | DateTime Start = t.DateStart.Date < FirstDate ? FirstDate : t.DateStart.Date; 132 | DateTime End = t.DateEnd.Date >= LastDay ? LastDay.AddDays(-1) : t.DateEnd.Date; 133 | 134 | // 7 => num of colum (a week..) 135 | // + 2 => the 1st row is the week name 136 | int x = (Start.Day + OffsetCell - 1) % 7 + 1; 137 | int y = (Start.Day + OffsetCell - 1) / 7 + 2; 138 | int s = (int)(End.Date - Start.Date).TotalDays + 1; 139 | 140 | classPosition = null; 141 | 142 | TaskPosition position = occupiedPosition[Start.Day]; 143 | 144 | if ( position.Top == false ) 145 | { 146 | for (int i = Start.Day; i < Start.Day + s; ++i) 147 | { 148 | occupiedPosition[i].Top = true; 149 | } 150 | classPosition = "monthly-task-first"; 151 | } 152 | else if ( position.Center == false ) 153 | { 154 | for (int i = Start.Day; i < Start.Day + s; ++i) 155 | { 156 | occupiedPosition[i].Center = true; 157 | } 158 | classPosition = "monthly-task-second"; 159 | } 160 | else if (position.Bottom == false) 161 | { 162 | for (int i = Start.Day; i < Start.Day + s; ++i) 163 | { 164 | occupiedPosition[i].Bottom = true; 165 | } 166 | classPosition = "monthly-task-bottom"; 167 | } 168 | 169 | string borderClass = "border-start"; 170 | do 171 | { 172 | string row = $"grid-column:{x} / span {s}; grid-row:{y};"; 173 | 174 | if ( classPosition is not null ) 175 | { 176 | if ( PriorityDisplay == PriorityLabel.Code ) 177 | { 178 | taskContent = string.IsNullOrWhiteSpace(t.Code) ? t.Caption : t.Code; 179 | } 180 | else 181 | { 182 | taskContent = string.IsNullOrWhiteSpace(t.Caption) ? t.Code : t.Caption; 183 | } 184 | 185 | // If there is time, add start time at begening 186 | if ( t.DateStart.Hour + t.DateStart.Minute > 0 ) 187 | { 188 | taskContent = $"{t.DateStart.ToString("t")} {taskContent}" ; 189 | } 190 | 191 | taskComment = string.IsNullOrWhiteSpace(t.Comment) ? null : t.Comment; 192 | 193 | string taskColor = Colors.GetHatching(t.FillStyle, t.Color); 194 | if (!String.IsNullOrEmpty(t.ForeColor)) 195 | { 196 | taskColor = taskColor + $"color:{t.ForeColor}"; 197 | } 198 | 199 |
206 | @taskContent 207 |
208 | } 209 | else 210 | { 211 | // Mode 2 tasks in cell => we display "more..." 212 |
215 | @($"+ {occupiedPosition[Start.Day].Counter - 2} ...") 216 |
217 | } 218 | 219 | onmMultiLine = false; 220 | if (x + s > 8) 221 | { 222 | onmMultiLine = true; 223 | 224 | Start = Start.AddDays(8 - x); 225 | End = t.DateEnd.Date >= LastDay ? LastDay.AddDays(-1) : t.DateEnd.Date; 226 | 227 | x = (Start.Day + OffsetCell - 1) % 7 + 1; 228 | y = (Start.Day + OffsetCell - 1) / 7 + 2; 229 | s = (int)(End.Date - Start.Date).TotalDays + 1; 230 | 231 | borderClass = string.Empty; 232 | } 233 | 234 | } while ( onmMultiLine ); 235 | 236 | // Start et End may have been modified, I redefine them for the whole month 237 | Start = t.DateStart.Date < FirstDate ? FirstDate : t.DateStart.Date; 238 | End = t.DateEnd.Date >= LastDay ? LastDay.AddDays(-1) : t.DateEnd.Date; 239 | 240 | for (int d = Start.Day; d <= End.Day; d++) 241 | { 242 | occupiedPosition[d].Counter++; 243 | } 244 | 245 | } 246 | } 247 | } 248 |
249 | -------------------------------------------------------------------------------- /BlazorCalendar/MonthlyView.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar; 2 | 3 | using BlazorCalendar.Models; 4 | using Microsoft.AspNetCore.Components; 5 | using Microsoft.AspNetCore.Components.Web; 6 | 7 | partial class MonthlyView : CalendarBase 8 | { 9 | [CascadingParameter(Name = "SelectedView")] 10 | public DisplayedView DisplayedView { get; set; } = DisplayedView.Monthly; 11 | 12 | private DateTime _firstdate; 13 | 14 | [CascadingParameter(Name = "FirstDate")] 15 | public DateTime FirstDate 16 | { 17 | get 18 | { 19 | if (_firstdate == DateTime.MinValue) _firstdate = DateTime.Today; 20 | return _firstdate.Date; 21 | } 22 | set 23 | { 24 | _firstdate = value; 25 | } 26 | } 27 | 28 | [CascadingParameter(Name = "TasksList")] 29 | public Tasks[]? TasksList { get; set; } 30 | 31 | [Parameter] 32 | public PriorityLabel PriorityDisplay { get; set; } = PriorityLabel.Code; 33 | 34 | [Parameter] 35 | public bool HighlightToday { get; set; } = false; 36 | 37 | [Parameter] 38 | public EventCallback OutsideCurrentMonthClick { get; set; } 39 | 40 | [Parameter] 41 | public EventCallback DayClick { get; set; } 42 | 43 | [Parameter] 44 | public EventCallback TaskClick { get; set; } 45 | 46 | [Parameter] 47 | public EventCallback DragStart { get; set; } 48 | 49 | [Parameter] 50 | public EventCallback DropTask { get; set; } 51 | 52 | private Tasks? TaskDragged; 53 | 54 | private enum StateCase 55 | { 56 | Before = 0, // First empty cells part 57 | InMonth = 1, 58 | After = 2, 59 | } 60 | 61 | private async Task HandleClickOutsideCurrentMonthClick(int AddMonth) 62 | { 63 | if (OutsideCurrentMonthClick.HasDelegate) 64 | { 65 | await OutsideCurrentMonthClick.InvokeAsync(AddMonth); 66 | } 67 | } 68 | 69 | 70 | private async Task ClickTaskInternal(MouseEventArgs e, int taskID, DateTime day) 71 | { 72 | if (!TaskClick.HasDelegate) 73 | return; 74 | 75 | List listID = new() 76 | { 77 | taskID 78 | }; 79 | 80 | ClickTaskParameter clickTaskParameter = new() 81 | { 82 | IDList = listID, 83 | X = e.ClientX, 84 | Y = e.ClientY, 85 | Day = day 86 | }; 87 | 88 | await TaskClick.InvokeAsync(clickTaskParameter); 89 | } 90 | 91 | private async Task ClickAllDayInternal(MouseEventArgs e, DateTime day) 92 | { 93 | if (day == default) 94 | return; 95 | 96 | if (!TaskClick.HasDelegate) 97 | return; 98 | 99 | // There can be several tasks in one day : 100 | List listID = new(); 101 | 102 | if (TasksList is not null) 103 | { 104 | for (var k = 0; k < TasksList.Length; k++) 105 | { 106 | Tasks t = TasksList[k]; 107 | 108 | if (t.DateStart.Date <= day.Date && day.Date <= t.DateEnd.Date) 109 | { 110 | listID.Add(t.ID); 111 | } 112 | } 113 | 114 | ClickTaskParameter clickTaskParameter = new() 115 | { 116 | IDList = listID, 117 | X = e.ClientX, 118 | Y = e.ClientY, 119 | Day = day 120 | }; 121 | 122 | await TaskClick.InvokeAsync(clickTaskParameter); 123 | } 124 | } 125 | 126 | private async Task ClickDayInternal(MouseEventArgs e, DateTime day) 127 | { 128 | if (!DayClick.HasDelegate) 129 | return; 130 | 131 | ClickEmptyDayParameter clickEmptyDayParameter = new() 132 | { 133 | Day = day, 134 | X = e.ClientX, 135 | Y = e.ClientY 136 | }; 137 | 138 | await DayClick.InvokeAsync(clickEmptyDayParameter); 139 | } 140 | 141 | private async Task HandleDragStart(int taskID) 142 | { 143 | TaskDragged = new Tasks() 144 | { 145 | ID = taskID 146 | }; 147 | 148 | DragDropParameter dragDropParameter = new() 149 | { 150 | taskID = TaskDragged.ID 151 | }; 152 | 153 | await DragStart.InvokeAsync(dragDropParameter); 154 | } 155 | 156 | private async Task HandleDayOnDrop(DateTime day) 157 | { 158 | if ( !Draggable ) 159 | return; 160 | 161 | if ( TaskDragged is null ) 162 | return; 163 | 164 | DragDropParameter dragDropParameter = new() 165 | { 166 | Day = day, 167 | taskID = TaskDragged.ID 168 | }; 169 | 170 | await DropTask.InvokeAsync(dragDropParameter); 171 | 172 | TaskDragged = null; 173 | } 174 | 175 | } 176 | -------------------------------------------------------------------------------- /BlazorCalendar/MonthlyView.razor.css: -------------------------------------------------------------------------------- 1 | .monthly-calendar { 2 | display: grid; 3 | width: 100%; 4 | grid-template-rows: 6vh; 5 | /*grid-template-columns: repeat(7, minmax(120px, 1fr)); 6 | grid-auto-rows: 120px;*/ 7 | grid-template-columns: repeat(7, minmax(8vw, 1fr)); 8 | grid-auto-rows: 12vh; 9 | overflow: auto; 10 | } 11 | 12 | .monthly-day { 13 | border-bottom: 1px solid rgba(166, 168, 179, 0.12); 14 | border-right: 1px solid rgba(166, 168, 179, 0.12); 15 | text-align: right; 16 | padding: 0.4vh 0.4vw; 17 | letter-spacing: 1px; 18 | font-size: 0.8em; 19 | box-sizing: border-box; 20 | color: #6d7377; 21 | position: relative; 22 | } 23 | 24 | .monthly-day:nth-of-type(n + 1):nth-of-type(-n + 7) { 25 | grid-row: 2; 26 | } 27 | 28 | .monthly-day:nth-of-type(n + 8):nth-of-type(-n + 14) { 29 | grid-row: 3; 30 | } 31 | 32 | .monthly-day:nth-of-type(n + 15):nth-of-type(-n + 21) { 33 | grid-row: 4; 34 | } 35 | 36 | .monthly-day:nth-of-type(n + 22):nth-of-type(-n + 28) { 37 | grid-row: 5; 38 | } 39 | 40 | .monthly-day:nth-of-type(n + 29):nth-of-type(-n + 35) { 41 | grid-row: 6; 42 | } 43 | 44 | .monthly-day:nth-of-type(n + 36):nth-of-type(-n + 43) { 45 | grid-row: 7; 46 | } 47 | 48 | .monthly-day:nth-of-type(7n + 1) { 49 | grid-column: 1/1; 50 | } 51 | 52 | .monthly-day:nth-of-type(7n + 2) { 53 | grid-column: 2/2; 54 | } 55 | 56 | .monthly-day:nth-of-type(7n + 3) { 57 | grid-column: 3/3; 58 | } 59 | 60 | .monthly-day:nth-of-type(7n + 4) { 61 | grid-column: 4/4; 62 | } 63 | 64 | .monthly-day:nth-of-type(7n + 5) { 65 | grid-column: 5/5; 66 | } 67 | 68 | .monthly-day:nth-of-type(7n + 6) { 69 | grid-column: 6/6; 70 | } 71 | 72 | .monthly-day:nth-of-type(7n + 7) { 73 | grid-column: 7/7; 74 | } 75 | 76 | .monthly-day--disabled { 77 | /*color: rgba(#98a0a6, 0.6); 78 | background-color: #ffffff;*/ 79 | background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f4f6f7' fill-opacity='1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E"); 80 | } 81 | 82 | .monthly-today { 83 | border: 3px solid #f75959; 84 | border-radius: 5px; 85 | } 86 | 87 | .monthly-task { 88 | border-radius: 3px; 89 | padding: 2px 8px 2px 6px; 90 | margin: 3px 11px 0 9px; 91 | font-size: 0.8em; 92 | font-weight: 600; 93 | position: relative; 94 | z-index: 1; 95 | color: #000; 96 | overflow: hidden; 97 | text-overflow: ellipsis; 98 | height: 2vh; 99 | } 100 | 101 | @media (max-width: 767.98px) { 102 | .monthly-task { 103 | padding: 0px 8px 0px 4px; 104 | margin: 3px 2px 0 4px; 105 | } 106 | } 107 | 108 | .monthly-task-first { 109 | align-self: start; 110 | margin-top: 22px; 111 | } 112 | 113 | .monthly-task-second { 114 | align-self: center; 115 | margin-top: 8px; 116 | } 117 | 118 | .monthly-task-bottom { 119 | align-self: end; 120 | margin-bottom: 14px; 121 | } 122 | 123 | .monthly-more-tasks { 124 | position: relative; 125 | cursor: zoom-in; 126 | align-self: end; 127 | margin-top: 40px; 128 | font-size: 0.6em; 129 | font-weight: 600; 130 | color: darkblue; 131 | align-self: end; 132 | margin-left: 10px; 133 | } -------------------------------------------------------------------------------- /BlazorCalendar/Styles/Colors.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCalendar.Styles; 2 | 3 | public sealed class Colors 4 | { 5 | public static string GetHatching(FillStyleEnum FillStyle, string HexaColor) 6 | { 7 | 8 | string css; 9 | switch (FillStyle) 10 | { 11 | case FillStyleEnum.BackwardDiagonal: 12 | css = $"background: repeating-linear-gradient(-45deg,{HexaColor}78 0px,{HexaColor}78 5px,{HexaColor} 5px,{HexaColor} 10px);"; 13 | break; 14 | 15 | case FillStyleEnum.CrossDots: 16 | css = $"background-image: radial-gradient({HexaColor} 3px, {HexaColor}78 1px),radial-gradient({HexaColor} 3px, transparent 1px);" + 17 | $"background-size: calc(14 * 1px) calc(14 * 1px);" + 18 | $"background-position: 0 0,calc(7 * 1px) calc(7 * 1px);"; 19 | break; 20 | 21 | case FillStyleEnum.ZigZag: 22 | css = $"background-color: {HexaColor}78 !important;" + 23 | $"background: linear-gradient(135deg, {HexaColor} 25%, transparent 25%) -8px 0,linear-gradient(225deg, {HexaColor} 25%, transparent 25%) -8px 0,linear-gradient(315deg, {HexaColor} 25%, transparent 25%),linear-gradient(45deg, {HexaColor} 25%, transparent 25%);" + 24 | "background-size: calc(2 * 8px) calc(2 * 8px);"; 25 | break; 26 | 27 | case FillStyleEnum.Triangles: 28 | css = $"background-image: linear-gradient(45deg, {HexaColor} 50%, {HexaColor}78 50%);" + 29 | $"background-size: 10px 10px;"; 30 | break; 31 | 32 | default: // FillStyleEnum.Solid 33 | css = $"background-color:{HexaColor};"; 34 | 35 | break; 36 | } 37 | 38 | return css; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /BlazorCalendar/WeekView.razor: -------------------------------------------------------------------------------- 1 | @using System.Globalization 2 | @using BlazorCalendar.Models 3 | @using BlazorCalendar.Styles 4 | 5 | @inherits CalendarBase 6 | 7 | @{ 8 | DateTime firstDateWeek = FirstDate.AddDays(-(int)(FirstDate.DayOfWeek - System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek + 7) % 7); 9 | 10 | string[] dayNames = CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedDayNames; 11 | string? isHidden = DisplayedView == DisplayedView.Weekly ? null : "hidden-element"; 12 | string? CSSbackground; 13 | string? taskColor; 14 | string? classPin; 15 | string? classPointer; 16 | 17 | // The sorting must be done each time we redraw in case the user moves the spots 18 | if (TasksList is not null) 19 | { 20 | TasksList = TasksList.OrderBy(x => x.DateStart) 21 | .ThenByDescending(x => x.DateEnd) 22 | .ToArray(); 23 | } 24 | } 25 | 26 |
27 | 28 | @for (var i = 0; i < 7; i++) 29 | { 30 | int d = Dates.GetNumOfDay(i); 31 | DateTime day = firstDateWeek.AddDays(i); 32 | 33 |
34 | 35 |
36 | @dayNames[d] @day.ToString("dd.MM") 37 |
38 | 39 |
40 | @{ 41 | CSSbackground = GetBackground(day); 42 | } 43 | @for (int hour = 0; hour < 24; hour++) 44 | { 45 | DateTime hours = day.AddHours(hour); 46 |
53 | @hours.ToString("HH:mm") 54 |
55 | 56 | @if (TasksList is not null) 57 | { 58 | int column = 1; 59 | 60 | for (var k = 0; k < TasksList.Length; k++) 61 | { 62 | Tasks t = TasksList[k]; 63 | 64 | if (t.DateEnd > hours && t.DateStart <= hours) 65 | { 66 | column++; 67 | 68 | taskColor = Colors.GetHatching(t.FillStyle, t.Color); 69 | taskColor = $"{taskColor};color:{t.ForeColor}"; 70 | 71 | classPin = string.IsNullOrWhiteSpace(t.Comment) ? null : " pin"; 72 | classPointer = " cursor-pointer"; 73 | 74 |
79 | @t.Code 80 |
81 | 82 | } 83 | } 84 | } 85 | 86 | } 87 |
88 | 89 |
90 | } 91 |
92 | -------------------------------------------------------------------------------- /BlazorCalendar/WeekView.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCalendar.Models; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.AspNetCore.Components.Web; 4 | 5 | namespace BlazorCalendar; 6 | 7 | partial class WeekView : CalendarBase 8 | { 9 | [CascadingParameter(Name = "SelectedView")] 10 | public DisplayedView DisplayedView { get; set; } = DisplayedView.Weekly; 11 | 12 | private DateTime _firstdate; 13 | [CascadingParameter(Name = "FirstDate")] 14 | public DateTime FirstDate 15 | { 16 | get 17 | { 18 | if (_firstdate == DateTime.MinValue) _firstdate = DateTime.Today; 19 | return _firstdate.Date; 20 | } 21 | set 22 | { 23 | _firstdate = value; 24 | } 25 | } 26 | 27 | [CascadingParameter(Name = "TasksList")] 28 | public Tasks[]? TasksList { get; set; } 29 | 30 | [Parameter] 31 | public PriorityLabel PriorityDisplay { get; set; } = PriorityLabel.Code; 32 | 33 | [Parameter] 34 | public bool HighlightToday { get; set; } = false; 35 | 36 | [Parameter] 37 | public EventCallback OutsideCurrentMonthClick { get; set; } 38 | 39 | [Parameter] 40 | public EventCallback DayClick { get; set; } 41 | 42 | [Parameter] 43 | public EventCallback EmptyDayClick { get; set; } 44 | 45 | [Parameter] 46 | public EventCallback TaskClick { get; set; } 47 | 48 | [Parameter] 49 | public EventCallback DragStart { get; set; } 50 | 51 | [Parameter] 52 | public EventCallback DropTask { get; set; } 53 | 54 | private Tasks? TaskDragged; 55 | private async Task HandleDragStart(int taskID) 56 | { 57 | TaskDragged = new Tasks() 58 | { 59 | ID = taskID 60 | }; 61 | 62 | DragDropParameter dragDropParameter = new() 63 | { 64 | taskID = TaskDragged.ID 65 | }; 66 | 67 | await DragStart.InvokeAsync(dragDropParameter); 68 | } 69 | 70 | private async Task HandleDayOnDrop(DateTime day) 71 | { 72 | if (!Draggable) 73 | return; 74 | 75 | if (TaskDragged is null) 76 | return; 77 | 78 | DragDropParameter dragDropParameter = new() 79 | { 80 | Day = day, 81 | taskID = TaskDragged.ID 82 | }; 83 | 84 | await DropTask.InvokeAsync(dragDropParameter); 85 | 86 | TaskDragged = null; 87 | } 88 | 89 | private async Task ClickDayInternal(MouseEventArgs e, DateTime day) 90 | { 91 | if (!DayClick.HasDelegate) 92 | return; 93 | 94 | ClickEmptyDayParameter clickEmptyDayParameter = new() 95 | { 96 | Day = day, 97 | X = e.ClientX, 98 | Y = e.ClientY 99 | }; 100 | 101 | await DayClick.InvokeAsync(clickEmptyDayParameter); 102 | } 103 | 104 | private async Task ClickTaskInternal(MouseEventArgs e, int taskID, DateTime day) 105 | { 106 | if (!TaskClick.HasDelegate) 107 | return; 108 | 109 | List listID = new() 110 | { 111 | taskID 112 | }; 113 | 114 | ClickTaskParameter clickTaskParameter = new() 115 | { 116 | IDList = listID, 117 | X = e.ClientX, 118 | Y = e.ClientY, 119 | Day = day 120 | }; 121 | 122 | await TaskClick.InvokeAsync(clickTaskParameter); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /BlazorCalendar/WeekView.razor.css: -------------------------------------------------------------------------------- 1 | .weekly-calendar { 2 | display: grid; 3 | width: 100%; 4 | overflow: auto; 5 | } 6 | 7 | .day-column { 8 | display: flex; 9 | flex-flow: column; 10 | } 11 | 12 | .day-header { 13 | grid-area: 1 / 1 / span 1 / span 2; 14 | } 15 | 16 | .day-cellule:hover { 17 | font-weight: 600; 18 | } 19 | 20 | .hours { 21 | border: 1px solid #c6c6c6; 22 | flex: 1; 23 | display: grid; 24 | justify-content: stretch; 25 | } 26 | 27 | .hour { 28 | grid-column-start: 1; 29 | font-size: 0.8em; 30 | padding-left: 0.5em; 31 | } 32 | 33 | .hour-task { 34 | text-align: center; 35 | font-size: 0.8em; 36 | font-weight: 600; 37 | overflow: hidden; 38 | text-overflow: ellipsis; 39 | } 40 | 41 | @media only screen and (max-width: 587px) { 42 | 43 | .day-cellule { 44 | font-size: 0.6em; 45 | padding-left: 0.3em; 46 | } 47 | 48 | .header-name { 49 | line-height:3vh; 50 | } 51 | } -------------------------------------------------------------------------------- /BlazorCalendar/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | -------------------------------------------------------------------------------- /BlazorCalendar/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/BlazorCalendar/icon.png -------------------------------------------------------------------------------- /BlazorCalendar/wwwroot/BlazorCalendar.css: -------------------------------------------------------------------------------- 1 | .hidden-element { 2 | display: none !important; 3 | } 4 | .noselect { 5 | -webkit-user-select: none; /* Safari */ 6 | user-select: none; 7 | } 8 | 9 | .cursor-pointer { 10 | cursor: pointer; 11 | } 12 | 13 | .cursor-top { 14 | cursor: n-resize; 15 | } 16 | 17 | .cursor-bottom { 18 | cursor: s-resize; 19 | } 20 | 21 | .header-name { 22 | font-size: 0.8em; 23 | text-transform: uppercase; 24 | color: #72777b; 25 | text-align: center; 26 | border-bottom: 1px solid rgba(166, 168, 179, 0.12); 27 | line-height: 6vh; 28 | font-weight: 500; 29 | overflow: hidden; 30 | text-overflow: ellipsis; 31 | background:#FFF; 32 | } 33 | 34 | .cellule-disabled { 35 | background: linear-gradient(-45deg, #F4F6F7 25%, #FF000000 25%, #FF000000 50%, #F4F6F7 50%, #F4F6F7 75%, #FF000000 75%, #FF000000); 36 | background-size: 8px 8px; 37 | } 38 | 39 | .fade-in { 40 | animation: fadeIn 0.4s; 41 | opacity: 1; 42 | } 43 | 44 | @keyframes fadeIn { 45 | from { 46 | opacity: 0; 47 | } 48 | 49 | to { 50 | opacity: 1; 51 | } 52 | } 53 | 54 | .frame { 55 | width: 100%; 56 | overflow-x: overlay; 57 | } 58 | /* AnnualView.razor */ 59 | .calendar-container { 60 | width: 98.5%; 61 | height: 80vh; 62 | border-top-color: #d6d8db; 63 | border-top-style: solid; 64 | border-top-width: 0.05vw; 65 | display: flex; 66 | min-width: fit-content; 67 | } 68 | 69 | .month-column { 70 | display: flex; 71 | flex: 1; 72 | flex-direction: column; 73 | overflow: hidden; 74 | } 75 | 76 | .cellule { 77 | border: solid #d6d8db; 78 | border-width: 0.00vw 0.05vw 0.05vw 0.05vw; 79 | } 80 | 81 | .month { 82 | background: #e6eaee; 83 | font-size: 0.8em; 84 | font-weight: 700; 85 | overflow: hidden; 86 | text-overflow: ellipsis; 87 | } 88 | 89 | .day-cellule { 90 | display: flex; 91 | flex: 1; 92 | flex-direction: row; 93 | font-size: 0.8em; 94 | color: #72777b; 95 | word-wrap: break-word; 96 | overflow: hidden; 97 | text-overflow: ellipsis; 98 | white-space: nowrap; 99 | } 100 | 101 | .day { 102 | width: 30%; 103 | max-width: 2.5vw; 104 | } 105 | 106 | .task { 107 | flex: 1; 108 | text-align: center; 109 | font-weight: 600; 110 | color: #000; 111 | word-wrap: break-word; 112 | overflow: hidden; 113 | text-overflow: ellipsis; 114 | position: relative; 115 | } 116 | 117 | .border-top { 118 | border-top-left-radius: 4px; 119 | border-top-right-radius: 4px; 120 | } 121 | 122 | .border-bottom { 123 | border-bottom-left-radius: 4px; 124 | border-bottom-right-radius: 4px; 125 | } 126 | 127 | .pin:after { 128 | /*http://apps.eky.hk/css-triangle-generator */ 129 | content: ""; 130 | position: absolute; 131 | height: 100%; 132 | right: 0px; 133 | border-style: solid; 134 | border-width: 0 0 7px 7px; 135 | border-color: transparent transparent #007bff transparent; 136 | } 137 | 138 | .pin-top:after { 139 | content: ""; 140 | position: absolute; 141 | right: 0px; 142 | border-style: solid; 143 | border-width: 0 7px 7px 0; 144 | border-color: transparent #9900ff transparent transparent; 145 | } 146 | 147 | .border-start { 148 | border-left-width: 3px !important; 149 | border-left-style: solid !important; 150 | border-left-color: #4d4d4d4c !important; 151 | } 152 | 153 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Christophe Peugnet 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 | # Blazor-Calendar 2 | [![NuGet](https://img.shields.io/nuget/v/BlazorCalendar.svg)](https://www.nuget.org/packages/BlazorCalendar/) ![BlazorCalendar Nuget Package](https://img.shields.io/nuget/dt/BlazorCalendar) 3 | [![GitHub](https://img.shields.io/github/license/tossnet/Blazor-Calendar?color=594ae2&logo=github&style=flat-square)](https://github.com/tossnet/Blazor-Calendar/blob/main/LICENSE) 4 | 5 | For Blazor Server or Blazor WebAssembly 6 | 7 | ## Live demo 8 | Blazor webassembly : https://tossnet.github.io/Blazor-Calendar/monthlyview 9 | 10 | ![blazorcalendar201](https://user-images.githubusercontent.com/3845786/158783479-35e614fe-fcca-4162-8e64-b5b33338251d.gif) 11 | 12 | ![monthlyView](https://user-images.githubusercontent.com/3845786/159467420-8140bf09-b24b-4880-91a2-036c9824336a.gif) 13 | 14 | ## Installation 15 | Latest version in here: [![NuGet](https://img.shields.io/nuget/v/BlazorCalendar.svg)](https://www.nuget.org/packages/BlazorCalendar/) 16 | 17 | To Install 18 | 19 | ``` 20 | Install-Package BlazorCalendar 21 | ``` 22 | or 23 | ``` 24 | dotnet add package BlazorCalendar 25 | ``` 26 | For client-side and server-side Blazor - add script section to _Layout.cshtml (head section) 27 | 28 | ```html 29 | 30 | ``` 31 | 32 | ## Documentation 33 | https://github.com/tossnet/Blazor-Calendar/wiki 34 | 35 | 36 | 37 | ## Release Notes 38 | 39 |
Version 2.7.1 40 | 41 | >- In the Weekview, the component did not correctly display the first day of the week according to Culture [Issue #24](https://github.com/tossnet/Blazor-Calendar/issues/24) 42 |
43 | 44 |
Version 2.7.0 45 | 46 | >- Add .NET9 and remove .NET6.0 47 |
48 | 49 |
Version 2.6.5 50 | 51 | >- Add WeekView (thanks [BruderJohn](https://github.com/BruderJohn) ) [Pull #13](https://github.com/tossnet/Blazor-Calendar/pull/13) 52 |
53 | 54 |
Version 2.6.4 55 | 56 | >- Use task IDs to identify containing div (for JS extensibility) [Pull #11](https://github.com/tossnet/Blazor-Calendar/pull/11) 57 |
58 | 59 |
Version 2.6.3 60 | 61 | >- In the monthly view, the calendar displays 3 items [Issue #8](https://github.com/tossnet/Blazor-Calendar/issues/8) 62 |
63 | 64 |
Version 2.6.1 65 | 66 | >- MonthlyView : new property HighlightToday (boolean) [Merge #9](https://github.com/tossnet/Blazor-Calendar/pull/9) 67 |
68 | 69 |
Version 2.5.3 70 | 71 | >- MonthlyView : fix: duplication of the number of additional tasks [Merge #7](https://github.com/tossnet/Blazor-Calendar/pull/7) 72 |
73 | 74 | 75 |
Version 2.5.2 76 | 77 | >- MonthlyView : return the day on the event ClickEmptyDayParameter. [Merge #5](https://github.com/tossnet/Blazor-Calendar/pull/5) 78 |
79 | 80 |
Version 2.5.1 81 | 82 | >- add new prop named (int) Type 83 | >- annualView : return the day on the event ClickEmptyDayParameter 84 |
85 | 86 |
Version 2.5.0 87 | 88 | >- new property "FillStyle" (Fill, BackwardDiagonal, ZigZag, Triangles, CrossDots) 89 |
90 | 91 |
Version 2.4.4 92 | 93 | >- Issue #3 94 |
95 | 96 |
Version 2.4.3 97 | 98 | >- Monthly View : we could move a task even if we didn't allow the move 99 |
100 | 101 |
Version 2.4.2 102 | 103 | >- Issue #2 104 |
105 | 106 |
Version 2.4.1 107 | 108 | >- add white background of headers. 109 | >- AnnualView : lightly rounded edge. 110 | >- In the monthlyview, If a task has a line break (next week) the left edge is not displayed anymore. 111 |
112 | 113 |
Version 2.4.0 114 | 115 | >- add white background of headers. 116 | >- In the monthlyview, display the start time if it exists. 117 |
118 | 119 |
Version 2.3.0 120 | 121 | >- improved positioning of tasks in the monthly view. 122 | >- AnnualView : add new event HeaderClick that returns a DateTime (the month clicked). 123 | >- Improvement of the css responsive . 124 |
125 | 126 |
Version 2.2.0 127 | 128 | >- fix bug. 129 | >- added the NotBeDraggable property. 130 |
131 | 132 |
Version 2.1.0 133 | 134 | >- css style improvement. 135 | >- Addition of hatching in the cells at the end of the month. 136 | >- Add a new view called MonthlyView. 137 |
138 | 139 | #### ⚠️ Breaking changes ⚠️ 140 | 141 |
Upgrading from 1.0 to 2.0 142 | 143 | * before version 2 : 144 | ```html 145 | 146 | ``` 147 | 148 | ```razor 149 | 150 | ``` 151 | 152 | * from version 2 : 153 | ```html 154 | 155 | ``` 156 | 157 | ```razor 158 | 159 | 160 | 161 | ``` 162 | **Reason** 163 | 164 | I anticipate creating another monthly view 165 |
166 | 167 | ### [RoadMap] 168 | 169 | * set a customizable background color for the current day 170 | * Add a list of remarkable days (specific background). The user could send the holidays for example 171 | -------------------------------------------------------------------------------- /samples/BlazorServer/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /samples/BlazorServer/BlazorServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0; net8.0; net9.0 5 | enable 6 | enable 7 | BlazorServer 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/Annualy.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using BlazorCalendar 3 | @using BlazorCalendar.Models 4 | 5 | 6 | Blazor Calendar Samples 7 | 8 |
9 | 10 | 11 | 12 | 13 | 17 |
18 | 19 | 20 |
21 |
22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 |
34 |
@fakeConsole
35 | 36 | @code { 37 | private DateTime today = DateTime.Today; 38 | private int months = 12; 39 | private List TasksList; 40 | private string fakeConsole = string.Empty; 41 | private BlazorCalendar.PriorityLabel PriorityDisplay = PriorityLabel.Code; 42 | private bool draggable = true; 43 | 44 | protected override void OnInitialized() 45 | { 46 | TasksList = new() 47 | { 48 | new Tasks { ID = 1, DateStart = today.AddDays(8), DateEnd = today.AddDays(8), Code = "CP", Color = "#19C319", Caption = "Lorem ipsum dolor sit amet", FillStyle=BlazorCalendar.FillStyleEnum.CrossDots }, 49 | new Tasks { ID = 2, DateStart = today.AddDays(50), DateEnd = today.AddDays(52), Code = "DEV", Color = "#FFD800", Comment="on Teams template", Caption = "Fusce quis purus eu ante", FillStyle=BlazorCalendar.FillStyleEnum.ZigZag }, 50 | new Tasks { ID = 3, DateStart = today.AddDays(40), DateEnd = today.AddDays(41), Code = "FORM", Color = "#FFC3FF", ForeColor = "#FF0000", Caption = "Lorem ipsum dolor sit amet" }, 51 | new Tasks { ID = 4, DateStart = today.AddDays(62), DateEnd = today.AddDays(62), Code = "DEV", Color = "#FFD800" }, 52 | new Tasks { ID = 5, DateStart = today.AddDays(62), DateEnd = today.AddDays(62), Code = "FORM", Color = "#FFC3FF", Caption = "Ut sit amet turpis eget" } , 53 | new Tasks { ID = 6, DateStart = today.AddDays(73).AddHours(8), DateEnd = today.AddDays(73).AddHours(9), Code = "MEETING", Color = "#2DD7D7", Comment="Julien's test" } 54 | }; 55 | } 56 | 57 | private void ChangeFirstDate(string value) 58 | { 59 | if (string.IsNullOrEmpty(value)) return; 60 | today = DateTime.Parse(value.ToString()); 61 | } 62 | 63 | private void ClicMonthNavigate(int monthToAdd) 64 | { 65 | today = today.AddMonths(monthToAdd); 66 | } 67 | 68 | private void HeaderClick(DateTime month) 69 | { 70 | fakeConsole = "HeaderClick :" + month.ToString("MMM yyyy"); 71 | } 72 | 73 | private void TaskClick(ClickTaskParameter clickTaskParameter) 74 | { 75 | fakeConsole = "ID task(s) :" + string.Join(", ", clickTaskParameter.IDList); 76 | } 77 | 78 | private void EmptyDayClick(ClickEmptyDayParameter clickEmptyDayParameter) 79 | { 80 | fakeConsole = "Empty day :" + clickEmptyDayParameter.Day.ToShortDateString(); 81 | } 82 | 83 | private void DragStart(DragDropParameter dragDropParameter) 84 | { 85 | fakeConsole = $"DragStart event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 86 | } 87 | 88 | private void DropTask(DragDropParameter dragDropParameter) 89 | { 90 | fakeConsole = $"DropTask event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 91 | 92 | Tasks taskDropped = TasksList.FirstOrDefault(t => t.ID == dragDropParameter.taskID); 93 | 94 | var TotalDay = (taskDropped.DateEnd - taskDropped.DateStart).TotalDays; 95 | taskDropped.DateEnd = dragDropParameter.Day.AddDays(TotalDay); 96 | taskDropped.DateStart = dragDropParameter.Day; 97 | } 98 | } -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model BlazorServer.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace BlazorServer.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | private readonly ILogger _logger; 16 | 17 | public ErrorModel(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/Monthly.razor: -------------------------------------------------------------------------------- 1 | @page "/monthlyview" 2 | @using BlazorCalendar 3 | @using BlazorCalendar.Models 4 | @using System.Globalization 5 | 6 |
7 | 8 | 9 | 10 | 11 | 15 |
16 | 17 | 18 |
19 |
20 | 21 | 24 | 32 | 33 | 34 |
35 |
@fakeConsole
36 | 37 | @code{ 38 | private DateTime today = DateTime.Today; 39 | private int months = 12; 40 | private List TasksList; 41 | private string fakeConsole = ""; 42 | private BlazorCalendar.PriorityLabel PriorityDisplay = PriorityLabel.Code; 43 | private bool draggable = true; 44 | 45 | protected override void OnInitialized() 46 | { 47 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("dz-DZ"); 48 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 49 | 50 | TasksList = new() 51 | { 52 | new Tasks { ID = 0, DateStart = today.AddDays(0), DateEnd = today.AddDays(1), Code = "HELLO", Color = "#FFD800", Caption = "Lorem ipsum dolor sit amet", FillStyle = FillStyleEnum.BackwardDiagonal }, 53 | new Tasks { ID = 1, DateStart = today.AddDays(4).AddHours(8).AddMinutes(30), DateEnd = today.AddDays(4).AddHours(11), Code = "😉 CP", Color = "#19C319", Caption = "Lorem ipsum dolor sit amet" } , 54 | new Tasks { ID = 2, DateStart = today.AddDays(30), DateEnd = today.AddDays(31), Code = "POD", Color = "#844fe7", Caption = "Podcast DevApps", FillStyle = FillStyleEnum.ZigZag } , 55 | new Tasks { ID = 3, DateStart = today.AddDays(20), DateEnd = today.AddDays(21), Code = "CALL", Color = "#eb3c37", ForeColor = "#222", Caption = "Lorem ipsum dolor sit amet", FillStyle=FillStyleEnum.CrossDots }, 56 | new Tasks { ID = 4, DateStart = today.AddDays(31), DateEnd = today.AddDays(31), Code = "MTG", Color = "#19C319", Caption = "MTG:France" }, 57 | new Tasks { ID = 5, DateStart = today.AddDays(40), DateEnd = today.AddDays(42), Code = "DEV", Color = "#FFD800", Comment="on Teams template", Caption = "Fusce quis purus eu ante" }, 58 | new Tasks { ID = 6, DateStart = today.AddDays(32), DateEnd = today.AddDays(33), Code = "MEET", Color = "#0d6efd" }, 59 | new Tasks { ID = 7, DateStart = today.AddDays(32), DateEnd = today.AddDays(32), Code = "BLAZOR", Color = "#FFC3FF", Caption = "Blazor Dev" } , 60 | new Tasks { ID = 8, DateStart = today.AddDays(45).AddHours(8), DateEnd = today.AddDays(45).AddHours(9), Code = "MEETING", Color = "#2DD7D7", Comment="Julien's test" }, 61 | new Tasks { ID = 9, DateStart = today.AddDays(-8), DateEnd = today.AddDays(-7), Code = "MEET⭐", Color = "#0d6efd",Caption = "MTG:France" } 62 | }; 63 | } 64 | 65 | private void ChangeFirstDate(string value) 66 | { 67 | if (string.IsNullOrEmpty(value)) return; 68 | today = DateTime.Parse(value.ToString()); 69 | } 70 | 71 | private void GoToday() 72 | { 73 | today = DateTime.Today; 74 | } 75 | 76 | private void ClicMonthNavigate(int monthToAdd) 77 | { 78 | today = today.AddMonths(monthToAdd); 79 | } 80 | 81 | private void OutsideCurrentMonthClick(int MonthAdded) 82 | { 83 | today = today.AddMonths(MonthAdded); 84 | } 85 | 86 | private void TaskClick(ClickTaskParameter clickTaskParameter) 87 | { 88 | fakeConsole = "ID task(s) :" + string.Join(", ", clickTaskParameter.IDList); 89 | } 90 | 91 | private void DayClick(ClickEmptyDayParameter clickEmptyDayParameter) 92 | { 93 | fakeConsole = "Empty day :" + clickEmptyDayParameter.Day.ToShortDateString(); 94 | } 95 | 96 | private void DragStart(DragDropParameter dragDropParameter) 97 | { 98 | fakeConsole = $"DragStart event : {dragDropParameter.taskID}"; 99 | } 100 | 101 | private void DropTask(DragDropParameter dragDropParameter) 102 | { 103 | fakeConsole = $"DropTask event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 104 | 105 | Tasks taskDropped = TasksList.FirstOrDefault(t => t.ID == dragDropParameter.taskID); 106 | 107 | var TotalDay = (taskDropped.DateEnd - taskDropped.DateStart).TotalDays; 108 | taskDropped.DateEnd = dragDropParameter.Day.AddDays(TotalDay); 109 | taskDropped.DateStart = dragDropParameter.Day; 110 | } 111 | } -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/SwitchViews.razor: -------------------------------------------------------------------------------- 1 | @page "/switchview" 2 | @using BlazorCalendar 3 | 4 |
5 | 6 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | @code{ 21 | private BlazorCalendar.DisplayedView SelectedView = DisplayedView.Annual; 22 | private string HeaderStyle = "cursor:pointer"; 23 | 24 | private void HeaderClick(DateTime monthclicked) 25 | { 26 | SelectedView = DisplayedView.Monthly; 27 | } 28 | } -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/Weekly.razor: -------------------------------------------------------------------------------- 1 | @page "/weeklyview" 2 | @using BlazorCalendar 3 | @using BlazorCalendar.Models 4 | @using System.Globalization 5 | 6 |
7 | 8 | 9 | 10 | 11 | 15 |
16 | 17 | 18 |
19 |
20 | 21 | 24 | 32 | 33 | 34 |
35 |
@fakeConsole
36 | 37 | @code { 38 | private DateTime today = DateTime.Today; 39 | private int months = 12; 40 | private List TasksList; 41 | private string fakeConsole = ""; 42 | private BlazorCalendar.PriorityLabel PriorityDisplay = PriorityLabel.Code; 43 | private bool draggable = true; 44 | 45 | protected override void OnInitialized() 46 | { 47 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("dz-DZ"); 48 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 49 | 50 | TasksList = new() 51 | { 52 | new Tasks { ID = 0, DateStart = today.AddDays(0), DateEnd = today.AddDays(1), Code = "HELLO", Color = "#FFD800", Caption = "Lorem ipsum dolor sit amet", FillStyle = FillStyleEnum.BackwardDiagonal }, 53 | new Tasks { ID = 1, DateStart = today.AddDays(4).AddHours(8), DateEnd = today.AddDays(4).AddHours(11), Code = "😉 CP", Color = "#19C319", Caption = "Lorem ipsum dolor sit amet" } , 54 | new Tasks { ID = 2, DateStart = today.AddDays(-2).AddHours(8), DateEnd = today.AddDays(-2).AddHours(20), Code = "POD", Color = "#844fe7", Caption = "Podcast DevApps", FillStyle = FillStyleEnum.ZigZag } , 55 | new Tasks { ID = 3, DateStart = today.AddHours(5), DateEnd = today.AddHours(10), Code = "CALL", Color = "#eb3c37", ForeColor = "#222", Caption = "Lorem ipsum dolor sit amet", FillStyle=FillStyleEnum.CrossDots }, 56 | new Tasks { ID = 4, DateStart = today.AddDays(31), DateEnd = today.AddDays(31), Code = "MTG", Color = "#19C319", Caption = "MTG:France" }, 57 | new Tasks { ID = 5, DateStart = today.AddDays(40), DateEnd = today.AddDays(42), Code = "DEV", Color = "#FFD800", Comment="on Teams template", Caption = "Fusce quis purus eu ante" }, 58 | new Tasks { ID = 6, DateStart = today.AddDays(32), DateEnd = today.AddDays(33), Code = "MEET", Color = "#0d6efd" }, 59 | new Tasks { ID = 7, DateStart = today.AddDays(32), DateEnd = today.AddDays(32), Code = "BLAZOR", Color = "#FFC3FF", Caption = "Blazor Dev" } , 60 | new Tasks { ID = 8, DateStart = today.AddDays(45).AddHours(8), DateEnd = today.AddDays(45).AddHours(9), Code = "MEETING", Color = "#2DD7D7", Comment="Julien's test" }, 61 | new Tasks { ID = 9, DateStart = today.AddDays(-8), DateEnd = today.AddDays(-7), Code = "MEET⭐", Color = "#0d6efd",Caption = "MTG:France" } 62 | }; 63 | } 64 | 65 | private void ChangeFirstDate(string value) 66 | { 67 | if (string.IsNullOrEmpty(value)) return; 68 | today = DateTime.Parse(value.ToString()); 69 | } 70 | 71 | private void GoToday() 72 | { 73 | today = DateTime.Today; 74 | } 75 | 76 | private void ClicMonthNavigate(int daysToAdd) 77 | { 78 | today = today.AddDays(daysToAdd); 79 | } 80 | 81 | private void OutsideCurrentMonthClick(int MonthAdded) 82 | { 83 | today = today.AddMonths(MonthAdded); 84 | } 85 | 86 | private void TaskClick(ClickTaskParameter clickTaskParameter) 87 | { 88 | fakeConsole = "ID task(s) :" + string.Join(", ", clickTaskParameter.IDList); 89 | } 90 | 91 | private void DayClick(ClickEmptyDayParameter clickEmptyDayParameter) 92 | { 93 | fakeConsole = $"Empty day :{clickEmptyDayParameter.Day.ToShortDateString()} {clickEmptyDayParameter.Day.ToShortTimeString()}"; 94 | } 95 | 96 | private void DragStart(DragDropParameter dragDropParameter) 97 | { 98 | fakeConsole = $"DragStart event : {dragDropParameter.taskID}"; 99 | } 100 | 101 | private void DropTask(DragDropParameter dragDropParameter) 102 | { 103 | fakeConsole = $"DropTask event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 104 | 105 | Tasks taskDropped = TasksList.FirstOrDefault(t => t.ID == dragDropParameter.taskID); 106 | 107 | var TotalDay = (taskDropped.DateEnd - taskDropped.DateStart).TotalDays; 108 | taskDropped.DateEnd = dragDropParameter.Day.AddDays(TotalDay); 109 | taskDropped.DateStart = dragDropParameter.Day; 110 | } 111 | } -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorServer.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = "_Layout"; 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/BlazorServer/Pages/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @namespace BlazorServer.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | @RenderBody() 21 | 22 |
23 | 24 | An error has occurred. This application may no longer respond until reloaded. 25 | 26 | 27 | An unhandled exception has occurred. See browser dev tools for details. 28 | 29 | Reload 30 | 🗙 31 |
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /samples/BlazorServer/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using Microsoft.AspNetCore.Components.Web; 3 | using System.Globalization; 4 | 5 | var builder = WebApplication.CreateBuilder(args); 6 | 7 | // Add services to the container. 8 | builder.Services.AddRazorPages(); 9 | builder.Services.AddServerSideBlazor(); 10 | 11 | CultureInfo.DefaultThreadCurrentCulture = CultureInfo.GetCultureInfo("en-US"); 12 | CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US"); 13 | 14 | var app = builder.Build(); 15 | 16 | // Configure the HTTP request pipeline. 17 | if (!app.Environment.IsDevelopment()) 18 | { 19 | app.UseExceptionHandler("/Error"); 20 | } 21 | 22 | 23 | app.UseStaticFiles(); 24 | 25 | app.UseRouting(); 26 | 27 | app.MapBlazorHub(); 28 | app.MapFallbackToPage("/_Host"); 29 | 30 | app.Run(); 31 | -------------------------------------------------------------------------------- /samples/BlazorServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "BlazorServer": { 4 | "commandName": "Project", 5 | "dotnetRunMessages": true, 6 | "launchBrowser": true, 7 | "applicationUrl": "http://localhost:5164", 8 | "environmentVariables": { 9 | "ASPNETCORE_ENVIRONMENT": "Development" 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/BlazorServer/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | Blazor-Calendar (Server) 4 | 5 |
6 | 9 | 10 |
11 |
12 | Code 13 |
14 | 15 |
16 | @Body 17 |
18 |
19 |
20 | -------------------------------------------------------------------------------- /samples/BlazorServer/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth) { 36 | display: none; 37 | } 38 | 39 | .top-row.auth { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a, .top-row .btn-link { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .top-row, article { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /samples/BlazorServer/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  9 | 10 |
11 | 33 |
34 | 35 | @code { 36 | private bool collapseNavMenu = true; 37 | 38 | private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; 39 | 40 | private void ToggleNavMenu() 41 | { 42 | collapseNavMenu = !collapseNavMenu; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /samples/BlazorServer/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /samples/BlazorServer/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorServer 10 | @using BlazorServer.Shared 11 | -------------------------------------------------------------------------------- /samples/BlazorServer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/BlazorServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/BlazorServer/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/BlazorServer/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/BlazorServer/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/BlazorServer/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/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /samples/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /samples/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /samples/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /samples/BlazorServer/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 | h1:focus { 8 | outline: none; 9 | } 10 | 11 | a, .btn-link { 12 | color: #0071c1; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .content { 22 | padding-top: 1.1rem; 23 | } 24 | 25 | .valid.modified:not([type=checkbox]) { 26 | outline: 1px solid #26b050; 27 | } 28 | 29 | .invalid { 30 | outline: 1px solid red; 31 | } 32 | 33 | .validation-message { 34 | color: red; 35 | } 36 | 37 | #blazor-error-ui { 38 | background: lightyellow; 39 | bottom: 0; 40 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 41 | display: none; 42 | left: 0; 43 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 44 | position: fixed; 45 | width: 100%; 46 | z-index: 1000; 47 | } 48 | 49 | #blazor-error-ui .dismiss { 50 | cursor: pointer; 51 | position: absolute; 52 | right: 0.75rem; 53 | top: 0.5rem; 54 | } 55 | 56 | .blazor-error-boundary { 57 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 58 | padding: 1rem 1rem 1rem 3.7rem; 59 | color: white; 60 | } 61 | 62 | .blazor-error-boundary::after { 63 | content: "An error has occurred." 64 | } 65 | 66 | 67 | .console { 68 | background: #262626; 69 | color: white; 70 | padding-left: 5px; 71 | font-family: monospace; 72 | line-height: 25px; 73 | font-size: 14px; 74 | } -------------------------------------------------------------------------------- /samples/BlazorServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/BlazorWebAssembly.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0; net8.0; net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Pages/Annualy.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using BlazorCalendar 3 | @using BlazorCalendar.Models 4 | 5 | 6 | Blazor Calendar Samples 7 | 8 |
9 | 10 | 11 | 12 | 13 | 17 |
18 | 19 | 20 |
21 |
22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 |
34 |
@fakeConsole
35 | 36 | @code{ 37 | private DateTime today = DateTime.Today; 38 | private int months = 8; 39 | private List TasksList; 40 | private string fakeConsole = string.Empty; 41 | private BlazorCalendar.PriorityLabel PriorityDisplay = PriorityLabel.Code; 42 | private bool draggable = true; 43 | 44 | protected override void OnInitialized() 45 | { 46 | TasksList = new() 47 | { 48 | new Tasks { ID = 1, DateStart = today.AddDays(8), DateEnd = today.AddDays(8), Code = "CP", Color = "#19C319", Caption = "Lorem ipsum dolor sit amet", FillStyle=BlazorCalendar.FillStyleEnum.CrossDots }, 49 | new Tasks { ID = 2, DateStart = today.AddDays(50), DateEnd = today.AddDays(52), Code = "DEV", Color = "#FFD800", Comment="on Teams template", Caption = "Fusce quis purus eu ante", FillStyle=BlazorCalendar.FillStyleEnum.ZigZag }, 50 | new Tasks { ID = 3, DateStart = today.AddDays(40), DateEnd = today.AddDays(41), Code = "FORM", Color = "#FFC3FF", ForeColor = "#FF0000", Caption = "Lorem ipsum dolor sit amet" }, 51 | new Tasks { ID = 4, DateStart = today.AddDays(62), DateEnd = today.AddDays(62), Code = "DEV", Color = "#FFD800" }, 52 | new Tasks { ID = 5, DateStart = today.AddDays(62), DateEnd = today.AddDays(62), Code = "FORM", Color = "#FFC3FF", Caption = "Ut sit amet turpis eget" } , 53 | new Tasks { ID = 6, DateStart = today.AddDays(73).AddHours(8), DateEnd = today.AddDays(73).AddHours(9), Code = "MEETING", Color = "#2DD7D7", Comment="Julien's test" } 54 | }; 55 | } 56 | 57 | private void ChangeFirstDate(string value) 58 | { 59 | if (string.IsNullOrEmpty(value)) return; 60 | today = DateTime.Parse(value.ToString()); 61 | } 62 | 63 | private void HeaderClick(DateTime month) 64 | { 65 | fakeConsole = "HeaderClick :" + month.ToString("MMM yyyy"); 66 | } 67 | 68 | private void ClicMonthNavigate(int monthToAdd) 69 | { 70 | today = today.AddMonths(monthToAdd); 71 | } 72 | 73 | private void TaskClick(ClickTaskParameter clickTaskParameter) 74 | { 75 | fakeConsole = "ID task(s) :" + string.Join(", ", clickTaskParameter.IDList); 76 | } 77 | 78 | private void EmptyDayClick(ClickEmptyDayParameter clickEmptyDayParameter) 79 | { 80 | fakeConsole = "Empty day :" + clickEmptyDayParameter.Day.ToShortDateString(); 81 | } 82 | 83 | private void DragStart(DragDropParameter dragDropParameter) 84 | { 85 | fakeConsole = $"DragStart event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 86 | } 87 | 88 | private void DropTask(DragDropParameter dragDropParameter) 89 | { 90 | fakeConsole = $"DropTask event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 91 | 92 | Tasks taskDropped = TasksList.FirstOrDefault(t => t.ID == dragDropParameter.taskID); 93 | 94 | var TotalDay = (taskDropped.DateEnd - taskDropped.DateStart).TotalDays; 95 | taskDropped.DateEnd = dragDropParameter.Day.AddDays(TotalDay); 96 | taskDropped.DateStart = dragDropParameter.Day; 97 | } 98 | } -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Pages/Monthly.razor: -------------------------------------------------------------------------------- 1 | @page "/monthlyview" 2 | @using BlazorCalendar 3 | @using BlazorCalendar.Models 4 | @using System.Globalization 5 | 6 |
7 | 8 | 9 | 10 | 11 | 15 |
16 | 17 | 18 |
19 |
20 | 21 | 24 | 32 | 33 | 34 |
35 |
@fakeConsole
36 | 37 | @code{ 38 | private DateTime today = DateTime.Today; 39 | private int months = 12; 40 | private List TasksList; 41 | private string fakeConsole = string.Empty; 42 | private BlazorCalendar.PriorityLabel PriorityDisplay = PriorityLabel.Code; 43 | private bool draggable = true; 44 | 45 | protected override void OnInitialized() 46 | { 47 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("dz-DZ"); 48 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 49 | 50 | TasksList = new() 51 | { 52 | new Tasks { ID = 0, DateStart = today.AddDays(0), DateEnd = today.AddDays(1), Code = "HELLO", Color = "#FFD800", Caption = "Lorem ipsum dolor sit amet", FillStyle = FillStyleEnum.BackwardDiagonal }, 53 | new Tasks { ID = 1, DateStart = today.AddDays(4).AddHours(8).AddMinutes(30), DateEnd = today.AddDays(4).AddHours(11), Code = "😉 CP", Color = "#19C319", Caption = "Lorem ipsum dolor sit amet" } , 54 | new Tasks { ID = 2, DateStart = today.AddDays(30), DateEnd = today.AddDays(31), Code = "POD", Color = "#844fe7", Caption = "Podcast DevApps", FillStyle = FillStyleEnum.ZigZag } , 55 | new Tasks { ID = 3, DateStart = today.AddDays(20), DateEnd = today.AddDays(21), Code = "CALL", Color = "#eb3c37", ForeColor = "#222", Caption = "Lorem ipsum dolor sit amet", FillStyle=FillStyleEnum.CrossDots }, 56 | new Tasks { ID = 4, DateStart = today.AddDays(31), DateEnd = today.AddDays(31), Code = "MTG", Color = "#19C319", Caption = "MTG:France" }, 57 | new Tasks { ID = 5, DateStart = today.AddDays(40), DateEnd = today.AddDays(42), Code = "DEV", Color = "#FFD800", Comment="on Teams template", Caption = "Fusce quis purus eu ante" }, 58 | new Tasks { ID = 6, DateStart = today.AddDays(32), DateEnd = today.AddDays(33), Code = "MEET", Color = "#0d6efd" }, 59 | new Tasks { ID = 7, DateStart = today.AddDays(32), DateEnd = today.AddDays(32), Code = "BLAZOR", Color = "#FFC3FF", Caption = "Blazor Dev" } , 60 | new Tasks { ID = 8, DateStart = today.AddDays(45).AddHours(8), DateEnd = today.AddDays(45).AddHours(9), Code = "MEETING", Color = "#2DD7D7", Comment="Julien's test" }, 61 | new Tasks { ID = 9, DateStart = today.AddDays(-8), DateEnd = today.AddDays(-7), Code = "MEET⭐", Color = "#0d6efd",Caption = "MTG:France" } 62 | }; 63 | } 64 | 65 | private void ChangeFirstDate(string value) 66 | { 67 | if (string.IsNullOrEmpty(value)) return; 68 | today = DateTime.Parse(value.ToString()); 69 | } 70 | 71 | private void GoToday() 72 | { 73 | today = DateTime.Today; 74 | } 75 | 76 | private void ClicMonthNavigate(int monthToAdd) 77 | { 78 | today = today.AddMonths(monthToAdd); 79 | } 80 | 81 | private void OutsideCurrentMonthClick(int MonthAdded) 82 | { 83 | today = today.AddMonths(MonthAdded); 84 | } 85 | 86 | private void TaskClick(ClickTaskParameter clickTaskParameter) 87 | { 88 | fakeConsole = "ID task(s) :" + string.Join(", ", clickTaskParameter.IDList); 89 | } 90 | 91 | private void DayClick(ClickEmptyDayParameter clickEmptyDayParameter) 92 | { 93 | fakeConsole = "Empty day :" + clickEmptyDayParameter.Day.ToShortDateString(); 94 | } 95 | 96 | private void DragStart(DragDropParameter dragDropParameter) 97 | { 98 | fakeConsole = $"DragStart event : {dragDropParameter.taskID}"; 99 | } 100 | 101 | private void DropTask(DragDropParameter dragDropParameter) 102 | { 103 | fakeConsole = $"DropTask event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 104 | 105 | Tasks taskDropped = TasksList.FirstOrDefault(t => t.ID == dragDropParameter.taskID); 106 | 107 | var TotalDay = (taskDropped.DateEnd - taskDropped.DateStart).TotalDays; 108 | taskDropped.DateEnd = dragDropParameter.Day.AddDays(TotalDay); 109 | taskDropped.DateStart = dragDropParameter.Day; 110 | } 111 | } -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Pages/SwitchViews.razor: -------------------------------------------------------------------------------- 1 | @page "/switchview" 2 | @using BlazorCalendar 3 | 4 |
5 | 6 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | @code{ 21 | private BlazorCalendar.DisplayedView SelectedView = DisplayedView.Annual; 22 | private string HeaderStyle = "cursor:pointer"; 23 | 24 | private void HeaderClick(DateTime monthclicked) 25 | { 26 | SelectedView = DisplayedView.Monthly; 27 | } 28 | } -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Pages/Weekly.razor: -------------------------------------------------------------------------------- 1 | @page "/weeklyview" 2 | @using BlazorCalendar 3 | @using BlazorCalendar.Models 4 | @using System.Globalization 5 | 6 |
7 | 8 | 9 | 10 | 11 | 15 |
16 | 17 | 18 |
19 |
20 | 21 | 24 | 32 | 33 | 34 |
35 |
@fakeConsole
36 | 37 | @code { 38 | private DateTime today = DateTime.Today; 39 | private int months = 12; 40 | private List TasksList; 41 | private string fakeConsole = ""; 42 | private BlazorCalendar.PriorityLabel PriorityDisplay = PriorityLabel.Code; 43 | private bool draggable = true; 44 | 45 | protected override void OnInitialized() 46 | { 47 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("dz-DZ"); 48 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 49 | 50 | TasksList = new() 51 | { 52 | new Tasks { ID = 0, DateStart = today.AddDays(0), DateEnd = today.AddDays(1), Code = "HELLO", Color = "#FFD800", Caption = "Lorem ipsum dolor sit amet", FillStyle = FillStyleEnum.BackwardDiagonal }, 53 | new Tasks { ID = 1, DateStart = today.AddDays(4).AddHours(8), DateEnd = today.AddDays(4).AddHours(11), Code = "😉 CP", Color = "#19C319", Caption = "Lorem ipsum dolor sit amet" } , 54 | new Tasks { ID = 2, DateStart = today.AddDays(-2).AddHours(8), DateEnd = today.AddDays(-2).AddHours(20), Code = "POD", Color = "#844fe7", Caption = "Podcast DevApps", FillStyle = FillStyleEnum.ZigZag } , 55 | new Tasks { ID = 3, DateStart = today.AddHours(5), DateEnd = today.AddHours(10), Code = "CALL", Color = "#eb3c37", ForeColor = "#222", Caption = "Lorem ipsum dolor sit amet", FillStyle=FillStyleEnum.CrossDots }, 56 | new Tasks { ID = 4, DateStart = today.AddDays(31), DateEnd = today.AddDays(31), Code = "MTG", Color = "#19C319", Caption = "MTG:France" }, 57 | new Tasks { ID = 5, DateStart = today.AddDays(40), DateEnd = today.AddDays(42), Code = "DEV", Color = "#FFD800", Comment="on Teams template", Caption = "Fusce quis purus eu ante" }, 58 | new Tasks { ID = 6, DateStart = today.AddDays(32), DateEnd = today.AddDays(33), Code = "MEET", Color = "#0d6efd" }, 59 | new Tasks { ID = 7, DateStart = today.AddDays(32), DateEnd = today.AddDays(32), Code = "BLAZOR", Color = "#FFC3FF", Caption = "Blazor Dev" } , 60 | new Tasks { ID = 8, DateStart = today.AddDays(45).AddHours(8), DateEnd = today.AddDays(45).AddHours(9), Code = "MEETING", Color = "#2DD7D7", Comment="Julien's test" }, 61 | new Tasks { ID = 9, DateStart = today.AddDays(-8), DateEnd = today.AddDays(-7), Code = "MEET⭐", Color = "#0d6efd",Caption = "MTG:France" } 62 | }; 63 | } 64 | 65 | private void ChangeFirstDate(string value) 66 | { 67 | if (string.IsNullOrEmpty(value)) return; 68 | today = DateTime.Parse(value.ToString()); 69 | } 70 | 71 | private void GoToday() 72 | { 73 | today = DateTime.Today; 74 | } 75 | 76 | private void ClicMonthNavigate(int daysToAdd) 77 | { 78 | today = today.AddDays(daysToAdd); 79 | } 80 | 81 | private void OutsideCurrentMonthClick(int MonthAdded) 82 | { 83 | today = today.AddMonths(MonthAdded); 84 | } 85 | 86 | private void TaskClick(ClickTaskParameter clickTaskParameter) 87 | { 88 | fakeConsole = "ID task(s) :" + string.Join(", ", clickTaskParameter.IDList); 89 | } 90 | 91 | private void DayClick(ClickEmptyDayParameter clickEmptyDayParameter) 92 | { 93 | fakeConsole = $"Empty day :{clickEmptyDayParameter.Day.ToShortDateString()} {clickEmptyDayParameter.Day.ToShortTimeString()}"; 94 | } 95 | 96 | private void DragStart(DragDropParameter dragDropParameter) 97 | { 98 | fakeConsole = $"DragStart event : {dragDropParameter.taskID}"; 99 | } 100 | 101 | private void DropTask(DragDropParameter dragDropParameter) 102 | { 103 | fakeConsole = $"DropTask event :{dragDropParameter.Day.ToShortDateString()} {dragDropParameter.taskID}"; 104 | 105 | Tasks taskDropped = TasksList.FirstOrDefault(t => t.ID == dragDropParameter.taskID); 106 | 107 | var TotalDay = (taskDropped.DateEnd - taskDropped.DateStart).TotalDays; 108 | taskDropped.DateEnd = dragDropParameter.Day.AddDays(TotalDay); 109 | taskDropped.DateStart = dragDropParameter.Day; 110 | } 111 | } -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorWebAssembly; 2 | using Microsoft.AspNetCore.Components.Web; 3 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 4 | using System.Globalization; 5 | 6 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 7 | builder.RootComponents.Add("#app"); 8 | builder.RootComponents.Add("head::after"); 9 | 10 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 11 | 12 | await builder.Build().RunAsync(); 13 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:57470", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "BlazorWebAssembly": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 16 | "applicationUrl": "http://localhost:5262", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "IIS Express": { 22 | "commandName": "IISExpress", 23 | "launchBrowser": true, 24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | Code 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  9 | 10 |
11 | 33 |
34 | 35 | @code { 36 | private bool collapseNavMenu = true; 37 | 38 | private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; 39 | 40 | private void ToggleNavMenu() 41 | { 42 | collapseNavMenu = !collapseNavMenu; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using BlazorWebAssembly 10 | @using BlazorWebAssembly.Shared 11 | -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/css/app.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 | h1:focus { 8 | outline: none; 9 | } 10 | 11 | a, .btn-link { 12 | color: #0071c1; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .content { 22 | padding-top: 1.1rem; 23 | } 24 | 25 | .valid.modified:not([type=checkbox]) { 26 | outline: 1px solid #26b050; 27 | } 28 | 29 | .invalid { 30 | outline: 1px solid red; 31 | } 32 | 33 | .validation-message { 34 | color: red; 35 | } 36 | 37 | #blazor-error-ui { 38 | background: lightyellow; 39 | bottom: 0; 40 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 41 | display: none; 42 | left: 0; 43 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 44 | position: fixed; 45 | width: 100%; 46 | z-index: 1000; 47 | } 48 | 49 | #blazor-error-ui .dismiss { 50 | cursor: pointer; 51 | position: absolute; 52 | right: 0.75rem; 53 | top: 0.5rem; 54 | } 55 | 56 | .blazor-error-boundary { 57 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 58 | padding: 1rem 1rem 1rem 3.7rem; 59 | color: white; 60 | } 61 | 62 | .blazor-error-boundary::after { 63 | content: "An error has occurred." 64 | } 65 | 66 | .console { 67 | background: #262626; 68 | color: white; 69 | padding-left: 5px; 70 | font-family: monospace; 71 | line-height: 25px; 72 | font-size: 14px; 73 | } -------------------------------------------------------------------------------- /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/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/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/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/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/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/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/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorWebAssembly/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorWebAssembly/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tossnet/Blazor-Calendar/c17717a8e933a24fced2da08f6f07a4f90d7c97d/samples/BlazorWebAssembly/wwwroot/icon-192.png -------------------------------------------------------------------------------- /samples/BlazorWebAssembly/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Blazor-Calendar (Wasm) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
Loading...
19 | 20 |
21 | An unhandled error has occurred. 22 | Reload 23 | 🗙 24 |
25 | 26 | 27 | 28 | 29 | --------------------------------------------------------------------------------