├── .gitignore
├── README.md
├── Slides.pptx
├── Snippets.demosnippets
├── demo
├── BlazorChartist.sln
├── Directory.Build.props
├── azure-pipelines.yml
├── samples
│ ├── ServerSample
│ │ ├── Pages
│ │ │ └── _Host.cshtml
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── ServerSample.csproj
│ │ ├── Startup.cs
│ │ ├── 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
│ └── WebAssemblySample
│ │ ├── App.razor
│ │ ├── Pages
│ │ └── Index.razor
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ ├── Shared
│ │ ├── MainLayout.razor
│ │ └── NavMenu.razor
│ │ ├── Startup.cs
│ │ ├── WebAssemblySample.csproj
│ │ ├── _Imports.razor
│ │ └── 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
│ │ ├── index.html
│ │ └── sample-data
│ │ └── weather.json
└── src
│ └── BlazorChartist
│ ├── .gitignore
│ ├── BlazorChartist.csproj
│ ├── Chart.razor
│ ├── Data
│ ├── ChartData.cs
│ ├── ChartType.cs
│ └── SeriesData.cs
│ ├── Series.cs
│ ├── StaticAssets
│ ├── BlazorChartist.ts
│ ├── StaticAssets.targets
│ ├── package-lock.json
│ ├── package.json
│ ├── tsconfig.json
│ └── webpack.config.js
│ └── _Imports.razor
├── notes.md
└── rebuild-branches.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | .vs/
2 | bin/
3 | obj/
4 | *.csproj.user
5 | node_modules/
6 | demo/artifacts/
7 | ~$Slides.pptx
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Demo.BlazorChartist
2 |
3 | This is a demonstration of a Blazor components package. It's not intended for actual use, because the feature set is very minimal. If you want to build a real 'chartist' package based on this, feel free to go ahead!
4 |
5 | # Usage
6 |
7 | 1. In a Blazor Server or Blazor WebAssembly project, add a reference to the `Demo.BlazorChartist` package.
8 |
9 | 2. In your `_Imports.razor` file, add the following statements:
10 |
11 | ```razor
12 | @using BlazorChartist
13 | @using BlazorChartist.Data
14 | ```
15 |
16 | 3. In your `_Host.cshtml` (for Blazor Server) or `index.html` (for Blazor WebAssembly) file, add the following tags somewhere *before* the reference to the Blazor `.js` file:
17 |
18 | ```html
19 |
20 |
21 | ```
22 |
23 | You're now ready to use the package. For example, inside a `.razor` file, add:
24 |
25 | ```razor
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | ```
35 |
36 | # Notes
37 |
38 | This is not intended to be a complete implementation of the Chartist API. The main focus is on demonstrating aspects of package creation.
39 |
--------------------------------------------------------------------------------
/Slides.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/Slides.pptx
--------------------------------------------------------------------------------
/Snippets.demosnippets:
--------------------------------------------------------------------------------
1 | TAB: Creating & running RCL
2 |
3 | - to CSS file
4 |
5 |
6 |
7 | TAB: Wrapping 3rd party JS
8 |
9 | - Whole Chart.razor contents making JS interop call
10 |
11 |
12 |
13 | @inject IJSRuntime JS
14 | @code {
15 | ElementReference elem;
16 |
17 | protected override async Task OnAfterRenderAsync(bool firstRender)
18 | {
19 | if (firstRender)
20 | {
21 | await JS.InvokeVoidAsync("BlazorChartist.createChart", elem);
22 | }
23 | }
24 | }
25 |
26 | TAB: Defining an API
27 |
28 | - private ChartData sampleData = ...
29 |
30 | @code {
31 | private static string[] labels = new[] { "Jan", "Feb", "Mar", "Apr", "May" };
32 | private static double[] oilPrices = new double[] { 51, 55, 68, 52, 51 };
33 | private static double[] trumpTweets = new double[] { 35, 19, 26, 68, 21 };
34 |
35 | private ChartData sampleData = new ChartData
36 | {
37 | Labels = labels,
38 | Series = new List
39 | {
40 | new SeriesData { Name = "Crude oil price ($)", Data = oilPrices },
41 | new SeriesData { Name = "Trump tweets", Data = trumpTweets },
42 | }
43 | };
44 | }
45 |
46 | - Two uses of
47 |
48 |
49 |
50 |
51 |
52 | TAB: Designing a better API
53 |
54 | - bool showTrumpTweets = true;
55 |
56 | bool showTrumpTweets = true;
57 |
58 | -
59 |
60 |
61 |
62 | - title="Graph of oil vs tweets" style="background-color: lightyellow;"
63 |
64 | title="Graph of oil vs tweets" style="background-color: lightyellow;"
65 |
66 | - [Parameter] with CaptureUnmatchedValues
67 |
68 | [Parameter(CaptureUnmatchedValues = true)] public Dictionary ExtraAttributes { get; set; }
69 |
70 | - @attributes="@ExtraAttributes"
71 |
72 | @attributes="@ExtraAttributes"
73 |
74 | TAB: Adding XML docs
75 |
76 | - Summary text for class
77 |
78 | Adds a data series to the enclosing component.
79 |
80 | - Summary text for Labels prop
81 |
82 | Specifies X-axis (catergory) labels.
83 |
84 | TAB: Ensuring compatibility
85 |
86 | TAB: Adding a Webpack build
87 |
88 | TAB: CI/CD
89 |
--------------------------------------------------------------------------------
/demo/BlazorChartist.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29519.161
5 | MinimumVisualStudioVersion = 15.0.26124.0
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0AFD331F-AB7B-4488-BB68-904D54C1A9F4}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorChartist", "src\BlazorChartist\BlazorChartist.csproj", "{EE88DA90-8BB5-4398-8486-73B2AF298600}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{7C6D788B-7ECE-4211-AD23-4404A6BC266A}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAssemblySample", "samples\WebAssemblySample\WebAssemblySample.csproj", "{E441D3D6-8B37-4103-BD80-FCDCF141703B}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerSample", "samples\ServerSample\ServerSample.csproj", "{C01C32F4-DE64-48D6-80BC-7A589E831052}"
15 | EndProject
16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{1A1FDCF0-9EAE-4638-B0A8-DC42D5451182}"
17 | ProjectSection(SolutionItems) = preProject
18 | azure-pipelines.yml = azure-pipelines.yml
19 | EndProjectSection
20 | EndProject
21 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "snippets", "snippets", "{A423D787-875F-4F20-B53C-A7F53F96448A}"
22 | ProjectSection(SolutionItems) = preProject
23 | ..\Snippets.demosnippets = ..\Snippets.demosnippets
24 | EndProjectSection
25 | EndProject
26 | Global
27 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
28 | Debug|Any CPU = Debug|Any CPU
29 | Release|Any CPU = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
32 | {EE88DA90-8BB5-4398-8486-73B2AF298600}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {EE88DA90-8BB5-4398-8486-73B2AF298600}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {EE88DA90-8BB5-4398-8486-73B2AF298600}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {EE88DA90-8BB5-4398-8486-73B2AF298600}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {E441D3D6-8B37-4103-BD80-FCDCF141703B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {E441D3D6-8B37-4103-BD80-FCDCF141703B}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {E441D3D6-8B37-4103-BD80-FCDCF141703B}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {E441D3D6-8B37-4103-BD80-FCDCF141703B}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {C01C32F4-DE64-48D6-80BC-7A589E831052}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {C01C32F4-DE64-48D6-80BC-7A589E831052}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {C01C32F4-DE64-48D6-80BC-7A589E831052}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {C01C32F4-DE64-48D6-80BC-7A589E831052}.Release|Any CPU.Build.0 = Release|Any CPU
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | GlobalSection(NestedProjects) = preSolution
49 | {EE88DA90-8BB5-4398-8486-73B2AF298600} = {0AFD331F-AB7B-4488-BB68-904D54C1A9F4}
50 | {E441D3D6-8B37-4103-BD80-FCDCF141703B} = {7C6D788B-7ECE-4211-AD23-4404A6BC266A}
51 | {C01C32F4-DE64-48D6-80BC-7A589E831052} = {7C6D788B-7ECE-4211-AD23-4404A6BC266A}
52 | EndGlobalSection
53 | GlobalSection(ExtensibilityGlobals) = postSolution
54 | SolutionGuid = {32C68C8B-3BF9-4B8C-AFC6-EFCD6E764DAA}
55 | EndGlobalSection
56 | EndGlobal
57 |
--------------------------------------------------------------------------------
/demo/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildThisFileDirectory)artifacts
5 | 0.1.0
6 | dev
7 |
8 |
9 |
--------------------------------------------------------------------------------
/demo/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | trigger:
2 | - master
3 |
4 | pool:
5 | vmImage: 'ubuntu-latest'
6 |
7 | variables:
8 | buildConfiguration: 'Release'
9 |
10 | steps:
11 | # Specify a particular version of the .NET SDK
12 | - task: UseDotNet@2
13 | displayName: 'Use .NET Core sdk'
14 | inputs:
15 | packageType: sdk
16 | version: 3.1.100
17 | installationPath: $(Agent.ToolsDirectory)/dotnet
18 |
19 | # Build the solution. Not strictly required to create the package,
20 | # but we want the build to fail if any sample can't build.
21 | - script: dotnet build --configuration $(buildConfiguration)
22 | workingDirectory: demo
23 | displayName: 'dotnet build $(buildConfiguration)'
24 |
25 | # Actually creates the NuGet package file
26 | - script: dotnet pack --configuration $(buildConfiguration) /p:VersionSuffix=$(Build.BuildNumber)
27 | workingDirectory: demo/src/BlazorChartist
28 | displayName: 'dotnet pack'
29 | - task: PublishBuildArtifacts@1
30 | inputs:
31 | PathtoPublish: 'demo/artifacts'
32 | ArtifactName: 'artifacts'
33 | publishLocation: 'Container'
34 |
35 | # Uploads the NuGet package file to nuget.org
36 | # Important notes:
37 | # 1. For this to work, you need to create a 'service connection' with the same name
38 | # as the 'publishFeedCredentials' value.
39 | # 2. For security, you *must* ensure that 'Make secrets available to builds of forks'
40 | # is disabled in your PR validation settings (inside build -> Edit -> Triggers).
41 | # Otherwise, PRs would be able to push new packages even without being merged.
42 | - task: NuGetCommand@2
43 | displayName: 'Publish to nuget.org'
44 | condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
45 | inputs:
46 | command: push
47 | packagesToPush: 'demo/artifacts/*.nupkg'
48 | nuGetFeedType: external
49 | publishFeedCredentials: 'NuGet demo'
50 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/Pages/_Host.cshtml:
--------------------------------------------------------------------------------
1 | @page "/"
2 | @namespace ServerSample.Pages
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 | @{
5 | Layout = null;
6 | }
7 |
8 |
9 |
10 |
11 |
12 |
13 | ServerSample
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | An error has occurred. This application may no longer respond until reloaded.
28 |
29 |
30 | An unhandled exception has occurred. See browser dev tools for details.
31 |
32 |
Reload
33 |
🗙
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Hosting;
10 | using Microsoft.Extensions.Logging;
11 |
12 | namespace ServerSample
13 | {
14 | public class Program
15 | {
16 | public static void Main(string[] args)
17 | {
18 | CreateHostBuilder(args).Build().Run();
19 | }
20 |
21 | public static IHostBuilder CreateHostBuilder(string[] args) =>
22 | Host.CreateDefaultBuilder(args)
23 | .ConfigureWebHostDefaults(webBuilder =>
24 | {
25 | webBuilder.UseStartup();
26 | });
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:54121",
7 | "sslPort": 44337
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "ServerSample": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/ServerSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Components;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.AspNetCore.HttpsPolicy;
9 | using Microsoft.Extensions.Configuration;
10 | using Microsoft.Extensions.DependencyInjection;
11 | using Microsoft.Extensions.Hosting;
12 |
13 | namespace ServerSample
14 | {
15 | public class Startup
16 | {
17 | public Startup(IConfiguration configuration)
18 | {
19 | Configuration = configuration;
20 | }
21 |
22 | public IConfiguration Configuration { get; }
23 |
24 | // This method gets called by the runtime. Use this method to add services to the container.
25 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
26 | public void ConfigureServices(IServiceCollection services)
27 | {
28 | services.AddRazorPages();
29 | services.AddServerSideBlazor();
30 | }
31 |
32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
33 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
34 | {
35 | if (env.IsDevelopment())
36 | {
37 | app.UseDeveloperExceptionPage();
38 | }
39 | else
40 | {
41 | app.UseExceptionHandler("/Error");
42 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
43 | app.UseHsts();
44 | }
45 |
46 | app.UseHttpsRedirection();
47 | app.UseStaticFiles();
48 |
49 | app.UseRouting();
50 |
51 | app.UseEndpoints(endpoints =>
52 | {
53 | endpoints.MapBlazorHub();
54 | endpoints.MapFallbackToPage("/_Host");
55 | });
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "DetailedErrors": true,
3 | "Logging": {
4 | "LogLevel": {
5 | "Default": "Information",
6 | "Microsoft": "Warning",
7 | "Microsoft.Hosting.Lifetime": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/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 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/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.
--------------------------------------------------------------------------------
/demo/samples/ServerSample/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 |
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 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/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'}
--------------------------------------------------------------------------------
/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
--------------------------------------------------------------------------------
/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
--------------------------------------------------------------------------------
/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014
9 | By P.J. Onori
10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net)
11 |
12 |
13 |
14 |
27 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
45 |
47 |
49 |
51 |
53 |
55 |
57 |
59 |
61 |
63 |
65 |
67 |
69 |
71 |
74 |
76 |
79 |
81 |
84 |
86 |
88 |
91 |
93 |
95 |
98 |
100 |
102 |
104 |
106 |
109 |
112 |
115 |
117 |
121 |
123 |
125 |
127 |
130 |
132 |
134 |
136 |
138 |
141 |
143 |
145 |
147 |
149 |
151 |
153 |
155 |
157 |
159 |
162 |
165 |
167 |
169 |
172 |
174 |
177 |
179 |
181 |
183 |
185 |
189 |
191 |
194 |
196 |
198 |
200 |
202 |
205 |
207 |
209 |
211 |
213 |
215 |
218 |
220 |
222 |
224 |
226 |
228 |
230 |
232 |
234 |
236 |
238 |
241 |
243 |
245 |
247 |
249 |
251 |
253 |
256 |
259 |
261 |
263 |
265 |
267 |
269 |
272 |
274 |
276 |
280 |
282 |
285 |
287 |
289 |
292 |
295 |
298 |
300 |
302 |
304 |
306 |
309 |
312 |
314 |
316 |
318 |
320 |
322 |
324 |
326 |
330 |
334 |
338 |
340 |
343 |
345 |
347 |
349 |
351 |
353 |
355 |
358 |
360 |
363 |
365 |
367 |
369 |
371 |
373 |
375 |
377 |
379 |
381 |
383 |
386 |
388 |
390 |
392 |
394 |
396 |
399 |
401 |
404 |
406 |
408 |
410 |
412 |
414 |
416 |
419 |
421 |
423 |
425 |
428 |
431 |
435 |
438 |
440 |
442 |
444 |
446 |
448 |
451 |
453 |
455 |
457 |
460 |
462 |
464 |
466 |
468 |
471 |
473 |
477 |
479 |
481 |
483 |
486 |
488 |
490 |
492 |
494 |
496 |
499 |
501 |
504 |
506 |
509 |
512 |
515 |
517 |
520 |
522 |
524 |
526 |
529 |
532 |
534 |
536 |
539 |
542 |
543 |
544 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
--------------------------------------------------------------------------------
/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/ServerSample/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
--------------------------------------------------------------------------------
/demo/samples/ServerSample/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 | a, .btn-link {
8 | color: #0366d6;
9 | }
10 |
11 | .btn-primary {
12 | color: #fff;
13 | background-color: #1b6ec2;
14 | border-color: #1861ac;
15 | }
16 |
17 | app {
18 | position: relative;
19 | display: flex;
20 | flex-direction: column;
21 | }
22 |
23 | .top-row {
24 | height: 3.5rem;
25 | display: flex;
26 | align-items: center;
27 | }
28 |
29 | .main {
30 | flex: 1;
31 | }
32 |
33 | .main .top-row {
34 | background-color: #f7f7f7;
35 | border-bottom: 1px solid #d6d5d5;
36 | justify-content: flex-end;
37 | }
38 |
39 | .main .top-row > a, .main .top-row .btn-link {
40 | white-space: nowrap;
41 | margin-left: 1.5rem;
42 | }
43 |
44 | .main .top-row a:first-child {
45 | overflow: hidden;
46 | text-overflow: ellipsis;
47 | }
48 |
49 | .sidebar {
50 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
51 | }
52 |
53 | .sidebar .top-row {
54 | background-color: rgba(0,0,0,0.4);
55 | }
56 |
57 | .sidebar .navbar-brand {
58 | font-size: 1.1rem;
59 | }
60 |
61 | .sidebar .oi {
62 | width: 2rem;
63 | font-size: 1.1rem;
64 | vertical-align: text-top;
65 | top: -2px;
66 | }
67 |
68 | .sidebar .nav-item {
69 | font-size: 0.9rem;
70 | padding-bottom: 0.5rem;
71 | }
72 |
73 | .sidebar .nav-item:first-of-type {
74 | padding-top: 1rem;
75 | }
76 |
77 | .sidebar .nav-item:last-of-type {
78 | padding-bottom: 1rem;
79 | }
80 |
81 | .sidebar .nav-item a {
82 | color: #d7d7d7;
83 | border-radius: 4px;
84 | height: 3rem;
85 | display: flex;
86 | align-items: center;
87 | line-height: 3rem;
88 | }
89 |
90 | .sidebar .nav-item a.active {
91 | background-color: rgba(255,255,255,0.25);
92 | color: white;
93 | }
94 |
95 | .sidebar .nav-item a:hover {
96 | background-color: rgba(255,255,255,0.1);
97 | color: white;
98 | }
99 |
100 | .content {
101 | padding-top: 1.1rem;
102 | }
103 |
104 | .navbar-toggler {
105 | background-color: rgba(255, 255, 255, 0.1);
106 | }
107 |
108 | .valid.modified:not([type=checkbox]) {
109 | outline: 1px solid #26b050;
110 | }
111 |
112 | .invalid {
113 | outline: 1px solid red;
114 | }
115 |
116 | .validation-message {
117 | color: red;
118 | }
119 |
120 | #blazor-error-ui {
121 | background: lightyellow;
122 | bottom: 0;
123 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
124 | display: none;
125 | left: 0;
126 | padding: 0.6rem 1.25rem 0.7rem 1.25rem;
127 | position: fixed;
128 | width: 100%;
129 | z-index: 1000;
130 | }
131 |
132 | #blazor-error-ui .dismiss {
133 | cursor: pointer;
134 | position: absolute;
135 | right: 0.75rem;
136 | top: 0.5rem;
137 | }
138 |
139 | @media (max-width: 767.98px) {
140 | .main .top-row:not(.auth) {
141 | display: none;
142 | }
143 |
144 | .main .top-row.auth {
145 | justify-content: space-between;
146 | }
147 |
148 | .main .top-row a, .main .top-row .btn-link {
149 | margin-left: 0;
150 | }
151 | }
152 |
153 | @media (min-width: 768px) {
154 | app {
155 | flex-direction: row;
156 | }
157 |
158 | .sidebar {
159 | width: 250px;
160 | height: 100vh;
161 | position: sticky;
162 | top: 0;
163 | }
164 |
165 | .main .top-row {
166 | position: sticky;
167 | top: 0;
168 | }
169 |
170 | .main > div {
171 | padding-left: 2rem !important;
172 | padding-right: 1.5rem !important;
173 | }
174 |
175 | .navbar-toggler {
176 | display: none;
177 | }
178 |
179 | .sidebar .collapse {
180 | /* Never collapse the sidebar for wide screens */
181 | display: block;
182 | }
183 | }
184 |
--------------------------------------------------------------------------------
/demo/samples/ServerSample/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/ServerSample/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/App.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sorry, there's nothing at this address.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/Pages/Index.razor:
--------------------------------------------------------------------------------
1 | @page "/"
2 |
3 | Hello, world!
4 |
5 | Welcome to your new app.
6 |
7 |
8 |
9 |
10 | @if (showTrumpTweets)
11 | {
12 |
13 | }
14 |
15 |
16 |
17 |
18 |
19 |
20 | @code {
21 | bool showTrumpTweets = true;
22 | private string[] labels = new[] { "Jan", "Feb", "Mar", "Apr", "May" };
23 | private double[] oilPrices = new double[] { 51, 55, 68, 52, 51 };
24 | private double[] trumpTweets = new double[] { 35, 19, 26, 68, 21 };
25 | }
26 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Blazor.Hosting;
2 |
3 | namespace WebAssemblySample
4 | {
5 | public class Program
6 | {
7 | public static void Main(string[] args)
8 | {
9 | CreateHostBuilder(args).Build().Run();
10 | }
11 |
12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) =>
13 | BlazorWebAssemblyHost.CreateDefaultBuilder()
14 | .UseBlazorStartup();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:54050/",
7 | "sslPort": 44386
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "WebAssemblySample": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "https://localhost:5001;http://localhost:5000"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/Shared/MainLayout.razor:
--------------------------------------------------------------------------------
1 | @inherits LayoutComponentBase
2 |
3 |
6 |
7 |
8 |
11 |
12 |
13 | @Body
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/Shared/NavMenu.razor:
--------------------------------------------------------------------------------
1 | @using System.Runtime.InteropServices
2 |
3 |
9 |
10 |
19 |
20 | @code {
21 | private string Environment =>
22 | RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY"))
23 | ? "WebAssembly" : "Server";
24 |
25 | private bool collapseNavMenu = true;
26 |
27 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
28 |
29 | private void ToggleNavMenu()
30 | {
31 | collapseNavMenu = !collapseNavMenu;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Components.Builder;
2 | using Microsoft.Extensions.DependencyInjection;
3 |
4 | namespace WebAssemblySample
5 | {
6 | public class Startup
7 | {
8 | public void ConfigureServices(IServiceCollection services)
9 | {
10 | }
11 |
12 | public void Configure(IComponentsApplicationBuilder app)
13 | {
14 | app.AddComponent("app");
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/WebAssemblySample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | 3.0
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using Microsoft.AspNetCore.Components.Forms
3 | @using Microsoft.AspNetCore.Components.Routing
4 | @using Microsoft.AspNetCore.Components.Web
5 | @using Microsoft.JSInterop
6 | @using WebAssemblySample
7 | @using WebAssemblySample.Shared
8 | @using BlazorChartist
9 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/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 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/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.
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/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 |
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 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/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'}
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014
9 | By P.J. Onori
10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net)
11 |
12 |
13 |
14 |
27 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
45 |
47 |
49 |
51 |
53 |
55 |
57 |
59 |
61 |
63 |
65 |
67 |
69 |
71 |
74 |
76 |
79 |
81 |
84 |
86 |
88 |
91 |
93 |
95 |
98 |
100 |
102 |
104 |
106 |
109 |
112 |
115 |
117 |
121 |
123 |
125 |
127 |
130 |
132 |
134 |
136 |
138 |
141 |
143 |
145 |
147 |
149 |
151 |
153 |
155 |
157 |
159 |
162 |
165 |
167 |
169 |
172 |
174 |
177 |
179 |
181 |
183 |
185 |
189 |
191 |
194 |
196 |
198 |
200 |
202 |
205 |
207 |
209 |
211 |
213 |
215 |
218 |
220 |
222 |
224 |
226 |
228 |
230 |
232 |
234 |
236 |
238 |
241 |
243 |
245 |
247 |
249 |
251 |
253 |
256 |
259 |
261 |
263 |
265 |
267 |
269 |
272 |
274 |
276 |
280 |
282 |
285 |
287 |
289 |
292 |
295 |
298 |
300 |
302 |
304 |
306 |
309 |
312 |
314 |
316 |
318 |
320 |
322 |
324 |
326 |
330 |
334 |
338 |
340 |
343 |
345 |
347 |
349 |
351 |
353 |
355 |
358 |
360 |
363 |
365 |
367 |
369 |
371 |
373 |
375 |
377 |
379 |
381 |
383 |
386 |
388 |
390 |
392 |
394 |
396 |
399 |
401 |
404 |
406 |
408 |
410 |
412 |
414 |
416 |
419 |
421 |
423 |
425 |
428 |
431 |
435 |
438 |
440 |
442 |
444 |
446 |
448 |
451 |
453 |
455 |
457 |
460 |
462 |
464 |
466 |
468 |
471 |
473 |
477 |
479 |
481 |
483 |
486 |
488 |
490 |
492 |
494 |
496 |
499 |
501 |
504 |
506 |
509 |
512 |
515 |
517 |
520 |
522 |
524 |
526 |
529 |
532 |
534 |
536 |
539 |
542 |
543 |
544 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SteveSandersonMS/presentation-2020-01-NdcBlazorComponentLibraries/f668ff0688dc96db1cc3933383574b1835a73b0c/demo/samples/WebAssemblySample/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/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 | a, .btn-link {
8 | color: #0366d6;
9 | }
10 |
11 | .btn-primary {
12 | color: #fff;
13 | background-color: #1b6ec2;
14 | border-color: #1861ac;
15 | }
16 |
17 | app {
18 | position: relative;
19 | display: flex;
20 | flex-direction: column;
21 | }
22 |
23 | .top-row {
24 | height: 3.5rem;
25 | display: flex;
26 | align-items: center;
27 | }
28 |
29 | .main {
30 | flex: 1;
31 | }
32 |
33 | .main .top-row {
34 | background-color: #f7f7f7;
35 | border-bottom: 1px solid #d6d5d5;
36 | justify-content: flex-end;
37 | }
38 |
39 | .main .top-row > a, .main .top-row .btn-link {
40 | white-space: nowrap;
41 | margin-left: 1.5rem;
42 | }
43 |
44 | .main .top-row a:first-child {
45 | overflow: hidden;
46 | text-overflow: ellipsis;
47 | }
48 |
49 | .sidebar {
50 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
51 | }
52 |
53 | .sidebar .top-row {
54 | background-color: rgba(0,0,0,0.4);
55 | }
56 |
57 | .sidebar .navbar-brand {
58 | font-size: 1.1rem;
59 | }
60 |
61 | .sidebar .oi {
62 | width: 2rem;
63 | font-size: 1.1rem;
64 | vertical-align: text-top;
65 | top: -2px;
66 | }
67 |
68 | .sidebar .nav-item {
69 | font-size: 0.9rem;
70 | padding-bottom: 0.5rem;
71 | }
72 |
73 | .sidebar .nav-item:first-of-type {
74 | padding-top: 1rem;
75 | }
76 |
77 | .sidebar .nav-item:last-of-type {
78 | padding-bottom: 1rem;
79 | }
80 |
81 | .sidebar .nav-item a {
82 | color: #d7d7d7;
83 | border-radius: 4px;
84 | height: 3rem;
85 | display: flex;
86 | align-items: center;
87 | line-height: 3rem;
88 | }
89 |
90 | .sidebar .nav-item a.active {
91 | background-color: rgba(255,255,255,0.25);
92 | color: white;
93 | }
94 |
95 | .sidebar .nav-item a:hover {
96 | background-color: rgba(255,255,255,0.1);
97 | color: white;
98 | }
99 |
100 | .content {
101 | padding-top: 1.1rem;
102 | }
103 |
104 | .navbar-toggler {
105 | background-color: rgba(255, 255, 255, 0.1);
106 | }
107 |
108 | .valid.modified:not([type=checkbox]) {
109 | outline: 1px solid #26b050;
110 | }
111 |
112 | .invalid {
113 | outline: 1px solid red;
114 | }
115 |
116 | .validation-message {
117 | color: red;
118 | }
119 |
120 | #blazor-error-ui {
121 | background: lightyellow;
122 | bottom: 0;
123 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
124 | display: none;
125 | left: 0;
126 | padding: 0.6rem 1.25rem 0.7rem 1.25rem;
127 | position: fixed;
128 | width: 100%;
129 | z-index: 1000;
130 | }
131 |
132 | #blazor-error-ui .dismiss {
133 | cursor: pointer;
134 | position: absolute;
135 | right: 0.75rem;
136 | top: 0.5rem;
137 | }
138 |
139 | @media (max-width: 767.98px) {
140 | .main .top-row:not(.auth) {
141 | display: none;
142 | }
143 |
144 | .main .top-row.auth {
145 | justify-content: space-between;
146 | }
147 |
148 | .main .top-row a, .main .top-row .btn-link {
149 | margin-left: 0;
150 | }
151 | }
152 |
153 | @media (min-width: 768px) {
154 | app {
155 | flex-direction: row;
156 | }
157 |
158 | .sidebar {
159 | width: 250px;
160 | height: 100vh;
161 | position: sticky;
162 | top: 0;
163 | }
164 |
165 | .main .top-row {
166 | position: sticky;
167 | top: 0;
168 | }
169 |
170 | .main > div {
171 | padding-left: 2rem !important;
172 | padding-right: 1.5rem !important;
173 | }
174 |
175 | .navbar-toggler {
176 | display: none;
177 | }
178 |
179 | .sidebar .collapse {
180 | /* Never collapse the sidebar for wide screens */
181 | display: block;
182 | }
183 | }
184 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/wwwroot/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | WebAssemblySample
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Loading...
17 |
18 |
19 | An unhandled error has occurred.
20 |
Reload
21 |
🗙
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/demo/samples/WebAssemblySample/wwwroot/sample-data/weather.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "date": "2018-05-06",
4 | "temperatureC": 1,
5 | "summary": "Freezing",
6 | "temperatureF": 33
7 | },
8 | {
9 | "date": "2018-05-07",
10 | "temperatureC": 14,
11 | "summary": "Bracing",
12 | "temperatureF": 57
13 | },
14 | {
15 | "date": "2018-05-08",
16 | "temperatureC": -13,
17 | "summary": "Freezing",
18 | "temperatureF": 9
19 | },
20 | {
21 | "date": "2018-05-09",
22 | "temperatureC": -16,
23 | "summary": "Balmy",
24 | "temperatureF": 4
25 | },
26 | {
27 | "date": "2018-05-10",
28 | "temperatureC": -2,
29 | "summary": "Chilly",
30 | "temperatureF": 29
31 | }
32 | ]
33 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/.gitignore:
--------------------------------------------------------------------------------
1 | wwwroot/
2 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/BlazorChartist.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | netstandard2.0
7 | 3.0
8 | Demo.BlazorChartist
9 | Demonstration of a Blazor components package. Not intended for actual use.
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/Chart.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 | @* Pass 'this' instance as a cascading parameter to descendants in tree *@
4 |
5 | @ChildContent
6 |
7 |
8 | @inject IJSRuntime JS
9 | @code {
10 | ElementReference elem;
11 |
12 | [Parameter(CaptureUnmatchedValues = true)] public Dictionary ExtraAttributes { get; set; }
13 | [Parameter] public RenderFragment ChildContent { get; set; }
14 | [Parameter] public ChartType Type { get; set; }
15 | [Parameter] public ChartData Data { get; set; } = new ChartData();
16 |
17 | ///
18 | /// Specifies X-axis (catergory) labels.
19 | ///
20 | [Parameter] public IEnumerable Labels { get; set; }
21 |
22 | protected override async Task OnAfterRenderAsync(bool firstRender)
23 | {
24 | if (firstRender)
25 | {
26 | await JS.InvokeVoidAsync("BlazorChartist.createChart", elem, Type.ToString());
27 | }
28 |
29 | Data.Labels = Labels;
30 |
31 | await JS.InvokeVoidAsync("BlazorChartist.updateChart", elem, Data);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/Data/ChartData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace BlazorChartist
4 | {
5 | public class ChartData
6 | {
7 | public IEnumerable Labels { get; set; }
8 |
9 | public List Series { get; set; } = new List();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/Data/ChartType.cs:
--------------------------------------------------------------------------------
1 | namespace BlazorChartist
2 | {
3 | public enum ChartType
4 | {
5 | Bar,
6 | Line,
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/Data/SeriesData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace BlazorChartist
5 | {
6 | public class SeriesData
7 | {
8 | public string Name { get; set; }
9 |
10 | public IEnumerable Data { get; set; } = Enumerable.Empty();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/Series.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Components;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace BlazorChartist
6 | {
7 | ///
8 | /// Adds a data series to the enclosing component.
9 | ///
10 | public class Series : ComponentBase, IDisposable
11 | {
12 | // Accept data via Razor syntax
13 | [Parameter] public string Name { get; set; }
14 | [Parameter] public IEnumerable Values { get; set; }
15 |
16 | // Each time the params change, update a 'SeriesData' instance
17 | private readonly SeriesData data = new SeriesData();
18 | protected override void OnParametersSet()
19 | {
20 | data.Name = Name;
21 | data.Data = Values;
22 | }
23 |
24 | // When we're first added to the UI, attach our data to parent
25 | // When we're removed from the UI, remove our data from parent
26 | [CascadingParameter] public Chart OwnerChart { get; set; }
27 |
28 | protected override void OnInitialized()
29 | => OwnerChart.Data.Series.Add(data);
30 |
31 | void IDisposable.Dispose()
32 | => OwnerChart.Data.Series.Remove(data);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/StaticAssets/BlazorChartist.ts:
--------------------------------------------------------------------------------
1 | import * as Chartist from 'chartist';
2 | import { IChartistBase, IChartOptions } from 'chartist';
3 |
4 | export default class BlazorChartist {
5 | static createChart(elem: Element, type: 'Bar' | 'Line' | 'Pie') {
6 | const constructor = Chartist[type];
7 | const chart: IChartistBase = new constructor(elem, { series: [] });
8 | elem['_chart'] = chart;
9 | }
10 |
11 | static updateChart(elem: Element, data: Chartist.IChartistData, options: Chartist.IChartOptions) {
12 | elem['_chart'].update(data, options);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/StaticAssets/StaticAssets.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/StaticAssets/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "build:Debug": "webpack --mode development",
4 | "build:Release": "webpack --mode production"
5 | },
6 | "devDependencies": {
7 | "@types/chartist": "^0.9.47",
8 | "chartist": "^0.11.4",
9 | "ts-loader": "^6.2.1",
10 | "typescript": "^3.7.5",
11 | "webpack": "^4.41.5",
12 | "webpack-cli": "^3.3.10"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/StaticAssets/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "include": ["./**/*.ts"]
3 | }
4 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/StaticAssets/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = (env, args) => ({
4 | resolve: { extensions: ['.ts', '.js'] },
5 | devtool: args.mode === 'development' ? 'source-map' : 'none',
6 | module: {
7 | rules: [{ test: /\.ts?$/, loader: 'ts-loader' }]
8 | },
9 | entry: './BlazorChartist.ts',
10 | output: {
11 | // Place output in wwwroot and export a top-level 'BlazorChartist' object
12 | path: path.join(__dirname, '..', 'wwwroot'),
13 | filename: 'BlazorChartist.js',
14 | libraryTarget: 'var',
15 | library: 'BlazorChartist',
16 | libraryExport: 'default'
17 | }
18 | });
19 |
--------------------------------------------------------------------------------
/demo/src/BlazorChartist/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Components.Web
2 | @using Microsoft.JSInterop
3 |
--------------------------------------------------------------------------------
/notes.md:
--------------------------------------------------------------------------------
1 | # Pre-demo checklist
2 |
3 | - Terminal
4 | - cd presentation-2020-01-NdcBlazorComponentLibraries
5 | - Ensure Git repo in clean state on `1-empty-solution`
6 | - rm -rf demo\src
7 | - rm -rf demo\samples
8 | - VS:
9 | - Open `BlazorChartist.sln`
10 | - Add snippets (unhide `snippets` solution folder if needed)
11 | - Font size
12 | - Hide `snippets` solution folder
13 | - Check you can find the "New RCL" project template
14 | - Powerpoint:
15 | - Slides opened
16 | - Timer ready
17 |
18 | --------------------------------------------------------------
19 |
20 | Building a nice RCL
21 |
22 | # Checkpoints
23 |
24 | ## Getting started ([1] Empty solution)
25 |
26 | Starts with blank solution
27 | - Create a new RCL in `src` called `BlazorChartist`
28 | - Explain "Support pages and views"
29 |
30 | ## With host projects ([2] With WebAssembly/Server sample projects)
31 |
32 | Now has `WebAssemblySample` and `ServerSample`
33 |
34 | - See webassembly and server projects running
35 | - From `WebAssemblySample`, reference `BlazorChartist`
36 | - In `Index.cshtml`, add - see it run
37 | - Update `_Imports.razor`
38 | - Now want to get CSS styles. In `index.html`, add:
39 |
40 | Need to restart app (unload and reload project) to see this take effect.
41 |
42 | ## With chartist.js/css ([3] With chartist files and empty Chart.razor)
43 |
44 | Now has .js/.css files in wwwroot, and referenced from `index.html` and `_Host.cshtml`
45 | The `BlazorChartist.js` file contains an init function with hardcoded data
46 | Also has empty `Chart.razor`
47 |
48 | - See it render
49 | - See sources, including JS
50 | - Call JS from `Chart.razor`:
51 |
52 |
53 |
54 | @inject IJSRuntime JS
55 | @code {
56 | ElementReference elem;
57 |
58 | protected override async Task OnAfterRenderAsync(bool firstRender)
59 | {
60 | if (firstRender)
61 | {
62 | await JS.InvokeVoidAsync("BlazorChartist.createChart", elem);
63 | }
64 | }
65 | }
66 |
67 | - See how createChart is defined in BlazorChartist.js
68 | - That's the core pattern of rendering elements and performing JS interop with them.
69 |
70 | ## With user-specifiable data ([4] With chart data types)
71 |
72 | - See new DTO types
73 | - See new parameters on `Chart.razor`
74 | - See how they are used in JS
75 | - See that it now renders blank
76 | - In `Index.razor`, define some data:
77 |
78 | @code {
79 | private static string[] labels = new[] { "Jan", "Feb", "Mar", "Apr", "May" };
80 | private static double[] oilPrices = new double[] { 51, 55, 68, 52, 51 };
81 | private static double[] trumpTweets = new double[] { 35, 19, 26, 68, 21 };
82 |
83 | private ChartData sampleData = new ChartData
84 | {
85 | Labels = labels,
86 | Series = new List
87 | {
88 | new SeriesData { Name = "Crude oil price ($)", Data = oilPrices },
89 | new SeriesData { Name = "Trump tweets", Data = trumpTweets },
90 | }
91 | };
92 | }
93 |
94 | - ... and use it:
95 |
96 |
97 |
98 |
99 |
100 | - Now want to move towards declaring the chart config in Razor syntax, not a C# object literal
101 | - First let's move "labels" into a top-level parameter
102 |
103 | [Parameter] public IEnumerable Labels { get; set; }
104 |
105 | - ... and use it before call to updateChart:
106 |
107 | Data.Labels = Labels;
108 |
109 | - ... then use it in `Index.razor` (pass Labels=@labels, and remove it from object literal)
110 |
111 | ## With series defined in Razor syntax ([5] With component)
112 |
113 | - See `Index.razor` and how it now has `` in markup
114 | - See how `Series.cs` implements this
115 | - Try it: error
116 | - Update `Chart.razor` to accept child content:
117 |
118 | [Parameter] public RenderFragment ChildContent { get; set; }
119 |
120 | - ... and it cascade itself to those children (can go anywhere):
121 |
122 |
123 | @ChildContent
124 |
125 |
126 | - Recap: can now declare data either in C# procedural code, or in Razor syntax
127 | - To show flexibility of Razor syntax, toggle a series:
128 | - In `Index.razor`, add `bool showTrumpTweets = true;`
129 | - ` `
130 | - Put `@if {showTrumpTweets}` around the trump tweets series
131 | - Point is, no need for a special API for this, nothing to document, obvious and flexible
132 |
133 | - What if consumer wants to specify some other attrib?
134 | Add `title="Graph of oil vs tweets" style="background-color: lightyellow;"`
135 | - Fails
136 | - Add param:
137 |
138 | [Parameter(CaptureUnmatchedValues = true)]
139 | public Dictionary ExtraAttributes { get; set; }
140 |
141 | - `@attributes="@ExtraAttributes"` - discuss adding before or after class
142 |
143 | - What if consumer wants to know what the parameters mean?
144 | - Hover over and `Type` attributes - no info
145 | - Add XML docs to `Series` class:
146 |
147 | ```cs
148 | ///
149 | /// Adds a data series to the enclosing component.
150 | ///
151 | ```
152 |
153 | - Also add to `Labels` property on `Chart.razor`:
154 |
155 | ```cs
156 | ///
157 | /// Specifies X-axis (catergory) labels.
158 | ///
159 | ```
160 |
161 | - Rebuild solution
162 | - Now see it take effect
163 |
164 | - Verify compatibility with all rendering modes
165 |
166 | - Show in network tab you really are on WebAssembly right now
167 | - Start up the ServerSample project
168 | - Verify you're really running server-side
169 | - See the prerendered output
170 | - Describe requirements for compatibility:
171 | - To run on server, need all JS interop to be async
172 | - To support prerendering, need all JS interop to be on OnAfterRenderAsync
173 | ... we already meet these criteria, so it just works.
174 |
175 | ## With webpack build ([6] With webpack build)
176 |
177 | - Currently our static assets system is weak
178 | - Having copy 3rd-party static files manually (and manually update them)
179 | - Have to write .js by hand (not TypeScript)
180 | - No bundling or minification
181 | - So in most realistic cases you'd want a Webpack + TypeScript setup
182 | - You may feel this is exactly what you're trying to avoid when using Blazor,
183 | but that's kind of the point. As a package author, you're taking on this
184 | pain so that your consumers don't have to. Having a webpack+typescript build
185 | system should only be part of how your package is produced, not how it's consumed.
186 | - See how there's no `wwwroot` dir any more
187 | - See how StaticAssets dir contains webpack config and TypeScript file
188 | - Skim-read `StaticAssets.targets`
189 | - Build and see it does NPM install and webpack build; see output
190 | - Build again and see it's incremental
191 |
192 | ## With CI/CD pipeline ([7] With AzDO pipeline)
193 |
194 | - Want validation on each commit and PRs, plus automatic release to NuGet.org
195 | - Don't have to pay for this! Azure Devops free tier is enough if you don't need very long or parallel builds.
196 | - See `azure-pipelines.yml`
197 | - Go to `https://dev.azure.com/SteveSandersonMS/BlazorChartist`
198 | - I already created this project on Azure DevOps, but haven't added a build pipeline yet
199 | - Pipelines, Create Pipeline
200 | - Code from GitHub
201 | - Pick `presentation-2020-01-NdcBlazorComponentLibraries` repo
202 | - Pick "Existing YAML file"
203 | - Pick `/demo/azure-pipeline.yml`
204 | - Run
205 | - Edit
206 | - Triggers
207 | - PR validation
208 | - Disable `Make secrets available to builds of forks`
209 | - Save
210 | - Go back and see the running pipeline
211 | - Hopefully it will be finishing about now
212 | - See the step where it pushes to NuGet.org
213 | - Be sure it's the first time you did it today, otherwise it will fail due to clashing version number
214 | - Look at list on `https://www.nuget.org/packages/Demo.BlazorChartist`
215 | - New version won't appear for 10 mins or so
216 |
--------------------------------------------------------------------------------
/rebuild-branches.sh:
--------------------------------------------------------------------------------
1 | BRANCH=$(git rev-parse --abbrev-ref HEAD)
2 | if [[ "$BRANCH" != "master" ]]; then
3 | echo 'Current branch is not master; aborting';
4 | exit 1;
5 | fi
6 |
7 | git branch -f 1-empty-solution `git log --grep="[1]" --format=format:%H`
8 | git branch -f 2-with-sample-projects `git log --grep="[2]" --format=format:%H`
9 | git branch -f 3-with-chartist-files `git log --grep="[3]" --format=format:%H`
10 | git branch -f 4-with-chart-data-types `git log --grep="[4]" --format=format:%H`
11 | git branch -f 5-with-series-component `git log --grep="[5]" --format=format:%H`
12 | git branch -f 6-with-webpack-build `git log --grep="[6]" --format=format:%H`
13 | git branch -f 7-with-azdo-pipeline `git log --grep="[7]" --format=format:%H`
14 |
--------------------------------------------------------------------------------