├── Demo ├── RazorComponents │ ├── Components │ │ ├── Pages │ │ │ ├── _ViewImports.cshtml │ │ │ ├── Index.razor │ │ │ ├── Bootstrap.razor │ │ │ ├── Inputbox.razor │ │ │ ├── FetchData.razor │ │ │ ├── Search.razor │ │ │ └── DynamicPageSize.razor │ │ ├── App.razor │ │ ├── _ViewImports.cshtml │ │ └── Shared │ │ │ ├── MainLayout.razor │ │ │ └── NavMenu.razor │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── images │ │ │ └── blazorpager.gif │ │ └── css │ │ │ ├── open-iconic │ │ │ ├── font │ │ │ │ ├── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ │ └── css │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── FONT-LICENSE │ │ │ └── site.css │ ├── Pages │ │ ├── _ViewImports.cshtml │ │ └── Index.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Services │ │ ├── WeatherForecast.cs │ │ ├── Order.cs │ │ └── WeatherForecastService.cs │ ├── Program.cs │ ├── RazorComponents.csproj │ └── Startup.cs └── BlazorHosted │ ├── BlazorHosted.Client │ ├── Pages │ │ ├── _ViewImports.cshtml │ │ ├── Index.cshtml │ │ ├── Bootstrap.cshtml │ │ ├── Inputbox.razor │ │ ├── FetchData.cshtml │ │ ├── Search.razor │ │ └── DynamicPageSize.razor │ ├── wwwroot │ │ ├── css │ │ │ ├── open-iconic │ │ │ │ ├── font │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ │ └── open-iconic.woff │ │ │ │ │ └── css │ │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── FONT-LICENSE │ │ │ └── site.css │ │ └── index.html │ ├── App.cshtml │ ├── _ViewImports.cshtml │ ├── Shared │ │ ├── MainLayout.cshtml │ │ ├── SurveyPrompt.cshtml │ │ └── NavMenu.cshtml │ ├── Startup.cs │ ├── Program.cs │ └── BlazorHosted.Client.csproj │ ├── BlazorHosted.Shared │ ├── PagedListData.cs │ ├── BlazorHosted.Shared.csproj │ ├── WeatherForecast.cs │ └── Order.cs │ └── BlazorHosted.Server │ ├── Program.cs │ ├── BlazorHosted.Server.csproj │ ├── Startup.cs │ └── Controllers │ └── SampleDataController.cs ├── BlazorPager ├── PagerItemType.cs ├── BlazorPager.csproj ├── docs │ ├── BlazorPagerDoc.zh-CHS.xml │ └── BlazorPagerDoc.xml ├── Properties.cs └── BlazorPager.cs ├── LICENSE ├── BlazorPager.sln ├── README_ZH-CN.md ├── .gitignore └── README.md /Demo/RazorComponents/Components/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/RazorComponents/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/images/blazorpager.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/RazorComponents/wwwroot/images/blazorpager.gif -------------------------------------------------------------------------------- /Demo/RazorComponents/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using RazorComponents.Components 2 | @namespace RazorComponents.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/RazorComponents/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/App.razor: -------------------------------------------------------------------------------- 1 | @* 2 | The Router component displays whichever component has a @page 3 | directive matching the current URI. 4 | *@ 5 | 6 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /Demo/RazorComponents/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Demo/RazorComponents/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Webdiyer/BlazorPager/HEAD/Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/App.cshtml: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Components.Layouts 3 | @using Microsoft.AspNetCore.Components.Routing 4 | @using Microsoft.JSInterop 5 | @using BlazorHosted.Client 6 | @using BlazorHosted.Client.Shared 7 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Components.Forms 3 | @using Microsoft.AspNetCore.Components.Layouts 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.JSInterop 6 | @using RazorComponents.Components.Shared 7 | -------------------------------------------------------------------------------- /BlazorPager/PagerItemType.cs: -------------------------------------------------------------------------------- 1 | namespace Webdiyer.AspNetCore 2 | { 3 | public partial class BlazorPager 4 | { 5 | internal enum PagerItemType : byte 6 | { 7 | Navigation, 8 | More, 9 | Number, 10 | Current, 11 | Disabled 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Shared/PagedListData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using X.PagedList; 3 | 4 | namespace BlazorHosted.Shared 5 | { 6 | public class PagedListData 7 | { 8 | public IEnumerable Items { get; set; } 9 | 10 | public PagedListMetaData MetaData { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Shared/BlazorHosted.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Services/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RazorComponents.Services 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF { get; set; } 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @page "/index/{page:int}" 3 | 4 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 5 | 6 |

BlazorPager with default settings:

7 | 8 | 9 | 10 | @functions{ 11 | [Parameter] 12 | private int Page { get; set; } 13 | 14 | } -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Shared/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BlazorHosted.Shared 6 | { 7 | public class WeatherForecast 8 | { 9 | public DateTime Date { get; set; } 10 | 11 | public int TemperatureC { get; set; } 12 | 13 | public string Summary { get; set; } 14 | 15 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazorHosted.Client 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/RazorComponents/Components/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @page "/index/{page:int}" 3 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 4 | 5 |

BlazorPager with default settings:

6 | <BlazorPager TotalItemCount="188" RoutePattern="index/{0}"></BlazorPager> 7 | 8 | 9 | 10 | 11 | @functions{ 12 | [Parameter] 13 | private int Page { get; set; } 14 | 15 | } -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazorHosted.Client 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/BlazorHosted/BlazorHosted.Client/Shared/SurveyPrompt.cshtml: -------------------------------------------------------------------------------- 1 | 11 | 12 | @functions { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] string Title { get; set; } 15 | } 16 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | BlazorPager Demo 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | 5 | namespace BlazorHosted.Server 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | BuildWebHost(args).Run(); 12 | } 13 | 14 | public static IWebHost BuildWebHost(string[] args) => 15 | WebHost.CreateDefaultBuilder(args) 16 | .UseConfiguration(new ConfigurationBuilder() 17 | .AddCommandLine(args) 18 | .Build()) 19 | .UseStartup() 20 | .Build(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace BlazorHosted.Shared 7 | { 8 | public class Order 9 | { 10 | 11 | public int OrderID 12 | { 13 | get;set; 14 | } 15 | 16 | public DateTime OrderDate 17 | { 18 | get; set; 19 | } 20 | 21 | 22 | public string CompanyName 23 | { 24 | get; set; 25 | } 26 | 27 | public string EmployeeName 28 | { 29 | get; set; 30 | } 31 | 32 | public string CustomerID 33 | { 34 | get; set; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Services/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace RazorComponents.Services 7 | { 8 | public class Order 9 | { 10 | 11 | public int OrderID 12 | { 13 | get;set; 14 | } 15 | 16 | public DateTime OrderDate 17 | { 18 | get; set; 19 | } 20 | 21 | 22 | public string CompanyName 23 | { 24 | get; set; 25 | } 26 | 27 | public string EmployeeName 28 | { 29 | get; set; 30 | } 31 | 32 | public string CustomerID 33 | { 34 | get; set; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Server/BlazorHosted.Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | 7.3 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Demo/RazorComponents/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 RazorComponents 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/RazorComponents/Services/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using X.PagedList; 5 | 6 | namespace RazorComponents.Services 7 | { 8 | public class WeatherForecastService 9 | { 10 | private static string[] Summaries = new[] 11 | { 12 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 13 | }; 14 | 15 | public Task> GetForecastAsync(DateTime startDate, int pageIndex, int pageSize) 16 | { 17 | var rng = new Random(); 18 | var data = Enumerable.Range(1, 58).Select(index => new WeatherForecast 19 | { 20 | Date = startDate.AddDays(index), 21 | TemperatureC = rng.Next(-20, 55), 22 | Summary = Summaries[rng.Next(Summaries.Length)] 23 | }).ToArray(); 24 | 25 | return data.ToPagedListAsync(pageIndex, pageSize); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Pages/Bootstrap.cshtml: -------------------------------------------------------------------------------- 1 | @page "/bootstrap" 2 | @page "/bootstrap/{page:int}" 3 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 4 | 5 |

Bootstrap style pagination

6 | 20 | 21 | @functions{ 22 | [Parameter] 23 | private int Page { get; set; } 24 | 25 | void ChangePage(int pageIndex) 26 | { 27 | StateHasChanged(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Tao Yang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/Pages/Bootstrap.razor: -------------------------------------------------------------------------------- 1 | @page "/bootstrap" 2 | @page "/bootstrap/{page:int}" 3 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 4 | 5 |

Bootstrap style pagination

6 | 20 | 21 | @functions{ 22 | [Parameter] 23 | private int Page { get; set; } 24 | 25 | void ChangePage(int pageIndex) 26 | { 27 | StateHasChanged(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Demo/RazorComponents/RazorComponents.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | 7.3 6 | <_RazorComponentInclude>Components\**\*.cshtml 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/BlazorHosted.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demo/RazorComponents/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/BlazorHosted/BlazorHosted.Client/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/RazorComponents/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page "{*clientPath}" 2 | 3 | 4 | 5 | 6 | 7 | BlazorPage Demo 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | @(await Html.RenderComponentAsync()) 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Server/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.AspNetCore.ResponseCompression; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Newtonsoft.Json.Serialization; 6 | using System.Linq; 7 | 8 | namespace BlazorHosted.Server 9 | { 10 | public class Startup 11 | { 12 | // This method gets called by the runtime. Use this method to add services to the container. 13 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 14 | public void ConfigureServices(IServiceCollection services) 15 | { 16 | services.AddMvc().AddNewtonsoftJson(); 17 | services.AddResponseCompression(); 18 | } 19 | 20 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 21 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 22 | { 23 | app.UseResponseCompression(); 24 | 25 | if (env.IsDevelopment()) 26 | { 27 | app.UseDeveloperExceptionPage(); 28 | } 29 | 30 | app.UseMvc(routes => 31 | { 32 | routes.MapRoute(name: "default", template: "{controller}/{action}/{id?}"); 33 | }); 34 | 35 | app.UseBlazor(); 36 | app.UseBlazorDebugging(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /BlazorPager/BlazorPager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Webdiyer.AspNetCore.BlazorPager 6 | Webdiyer.AspNetCore 7 | Webdiyer 8 | 9 | 0.1.0.0 10 | 0.1.0.0 11 | Pagination component for Asp.net core Blazor. 12 | http://www.webdiyer.com 13 | BlazorPager;Pagination;paging 14 | 0.1.0.0 15 | Copyright © 2019 Webdiyer 16 | Initial release, support Blazor 0.9! 17 | git 18 | true 19 | MIT 20 | BlazorPager 21 | https://github.com/Webdiyer/BlazorPager 22 | 23 | 24 | 25 | E:\GitHub\BlazorPager\BlazorPager\docs\Webdiyer.AspNetCore.BlazorPager.xml 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Demo/RazorComponents/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.Hosting; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.AspNetCore.HttpsPolicy; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Hosting; 11 | using RazorComponents.Components; 12 | using RazorComponents.Services; 13 | 14 | namespace RazorComponents 15 | { 16 | public class Startup 17 | { 18 | // This method gets called by the runtime. Use this method to add services to the container. 19 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 20 | public void ConfigureServices(IServiceCollection services) 21 | { 22 | services.AddMvc() 23 | .AddNewtonsoftJson(); 24 | 25 | services.AddRazorComponents(); 26 | 27 | services.AddSingleton(); 28 | } 29 | 30 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 31 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 32 | { 33 | if (env.IsDevelopment()) 34 | { 35 | app.UseDeveloperExceptionPage(); 36 | } 37 | else 38 | { 39 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 40 | app.UseHsts(); 41 | } 42 | 43 | app.UseHttpsRedirection(); 44 | app.UseStaticFiles(); 45 | 46 | app.UseRouting(routes => 47 | { 48 | routes.MapRazorPages(); 49 | routes.MapComponentHub("app"); 50 | }); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 41 |
42 | 43 | @functions { 44 | bool collapseNavMenu = true; 45 | 46 | string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 47 | 48 | void ToggleNavMenu() 49 | { 50 | collapseNavMenu = !collapseNavMenu; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Shared/NavMenu.cshtml: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 41 |
42 | 43 | @functions { 44 | bool collapseNavMenu = true; 45 | 46 | string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 47 | 48 | void ToggleNavMenu() 49 | { 50 | collapseNavMenu = !collapseNavMenu; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Server/Controllers/SampleDataController.cs: -------------------------------------------------------------------------------- 1 | using BlazorHosted.Shared; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.AspNetCore.Mvc; 4 | using System; 5 | using System.IO; 6 | using System.Linq; 7 | using X.PagedList; 8 | 9 | namespace BlazorHosted.Server.Controllers 10 | { 11 | [Route("api/[controller]")] 12 | public class SampleDataController : Controller 13 | { 14 | public SampleDataController(IHostingEnvironment env) 15 | { 16 | Env = env; 17 | } 18 | private IHostingEnvironment Env; 19 | 20 | private static string[] Summaries = new[] 21 | { 22 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 23 | }; 24 | 25 | 26 | [HttpGet("[action]")] 27 | public PagedListData WeatherForecasts(int pageIndex, int pageSize) 28 | { 29 | var rng = new Random(); 30 | var data = Enumerable.Range(1, 85).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }).ToPagedList(pageIndex, pageSize); 36 | return new PagedListData { Items = data, MetaData = data.GetMetaData() }; 37 | } 38 | 39 | [HttpGet("[action]")] 40 | public PagedListData Orders(string companyName,int pageIndex, int pageSize) 41 | { 42 | var path = Path.Combine(Env.ContentRootPath, "orders.json"); 43 | var ods = Newtonsoft.Json.JsonConvert.DeserializeObject(System.IO.File.ReadAllText(path)); 44 | IPagedList orders; 45 | if (!string.IsNullOrWhiteSpace(companyName)) 46 | { 47 | orders = ods.Where(o => o.CompanyName.Contains(companyName)).ToPagedList(pageIndex, pageSize); 48 | } 49 | else 50 | { 51 | orders = ods.ToPagedList(pageIndex, pageSize); 52 | } 53 | return new PagedListData { Items = orders, MetaData = orders.GetMetaData() }; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | app { 8 | position: relative; 9 | display: flex; 10 | flex-direction: column; 11 | } 12 | 13 | .top-row { 14 | height: 3.5rem; 15 | display: flex; 16 | align-items: center; 17 | } 18 | 19 | .main { 20 | flex: 1; 21 | } 22 | 23 | .main .top-row { 24 | background-color: #e6e6e6; 25 | border-bottom: 1px solid #d6d5d5; 26 | } 27 | 28 | .sidebar { 29 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 30 | } 31 | 32 | .sidebar .top-row { 33 | background-color: rgba(0,0,0,0.4); 34 | } 35 | 36 | .sidebar .navbar-brand { 37 | font-size: 1.1rem; 38 | } 39 | 40 | .sidebar .oi { 41 | width: 2rem; 42 | font-size: 1.1rem; 43 | vertical-align: text-top; 44 | top: -2px; 45 | } 46 | 47 | .nav-item { 48 | font-size: 0.9rem; 49 | padding-bottom: 0.5rem; 50 | } 51 | 52 | .nav-item:first-of-type { 53 | padding-top: 1rem; 54 | } 55 | 56 | .nav-item:last-of-type { 57 | padding-bottom: 1rem; 58 | } 59 | 60 | .nav-item a { 61 | color: #d7d7d7; 62 | border-radius: 4px; 63 | height: 3rem; 64 | display: flex; 65 | align-items: center; 66 | line-height: 3rem; 67 | } 68 | 69 | .nav-item a.active { 70 | background-color: rgba(255,255,255,0.25); 71 | color: white; 72 | } 73 | 74 | .nav-item a:hover { 75 | background-color: rgba(255,255,255,0.1); 76 | color: white; 77 | } 78 | 79 | .content { 80 | padding-top: 1.1rem; 81 | } 82 | 83 | .navbar-toggler { 84 | background-color: rgba(255, 255, 255, 0.1); 85 | } 86 | 87 | @media (max-width: 767.98px) { 88 | .main .top-row { 89 | display: none; 90 | } 91 | } 92 | 93 | @media (min-width: 768px) { 94 | app { 95 | flex-direction: row; 96 | } 97 | 98 | .sidebar { 99 | width: 250px; 100 | height: 100vh; 101 | position: sticky; 102 | top: 0; 103 | } 104 | 105 | .main .top-row { 106 | position: sticky; 107 | top: 0; 108 | } 109 | 110 | .main > div { 111 | padding-left: 2rem !important; 112 | padding-right: 1.5rem !important; 113 | } 114 | 115 | .navbar-toggler { 116 | display: none; 117 | } 118 | 119 | .sidebar .collapse { 120 | /* Never collapse the sidebar for wide screens */ 121 | display: block; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | app { 8 | position: relative; 9 | display: flex; 10 | flex-direction: column; 11 | } 12 | 13 | .top-row { 14 | height: 3.5rem; 15 | display: flex; 16 | align-items: center; 17 | } 18 | 19 | .main { 20 | flex: 1; 21 | } 22 | 23 | .main .top-row { 24 | background-color: #e6e6e6; 25 | border-bottom: 1px solid #d6d5d5; 26 | } 27 | 28 | .sidebar { 29 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 30 | } 31 | 32 | .sidebar .top-row { 33 | background-color: rgba(0,0,0,0.4); 34 | } 35 | 36 | .sidebar .navbar-brand { 37 | font-size: 1.1rem; 38 | } 39 | 40 | .sidebar .oi { 41 | width: 2rem; 42 | font-size: 1.1rem; 43 | vertical-align: text-top; 44 | top: -2px; 45 | } 46 | 47 | .nav-item { 48 | font-size: 0.9rem; 49 | padding-bottom: 0.5rem; 50 | } 51 | 52 | .nav-item:first-of-type { 53 | padding-top: 1rem; 54 | } 55 | 56 | .nav-item:last-of-type { 57 | padding-bottom: 1rem; 58 | } 59 | 60 | .nav-item a { 61 | color: #d7d7d7; 62 | border-radius: 4px; 63 | height: 3rem; 64 | display: flex; 65 | align-items: center; 66 | line-height: 3rem; 67 | } 68 | 69 | .nav-item a.active { 70 | background-color: rgba(255,255,255,0.25); 71 | color: white; 72 | } 73 | 74 | .nav-item a:hover { 75 | background-color: rgba(255,255,255,0.1); 76 | color: white; 77 | } 78 | 79 | .content { 80 | padding-top: 1.1rem; 81 | } 82 | 83 | .navbar-toggler { 84 | background-color: rgba(255, 255, 255, 0.1); 85 | } 86 | 87 | @media (max-width: 767.98px) { 88 | .main .top-row { 89 | display: none; 90 | } 91 | } 92 | 93 | @media (min-width: 768px) { 94 | app { 95 | flex-direction: row; 96 | } 97 | 98 | .sidebar { 99 | width: 250px; 100 | height: 100vh; 101 | position: sticky; 102 | top: 0; 103 | } 104 | 105 | .main .top-row { 106 | position: sticky; 107 | top: 0; 108 | } 109 | 110 | .main > div { 111 | padding-left: 2rem !important; 112 | padding-right: 1.5rem !important; 113 | } 114 | 115 | .navbar-toggler { 116 | display: none; 117 | } 118 | 119 | .sidebar .collapse { 120 | /* Never collapse the sidebar for wide screens */ 121 | display: block; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /BlazorPager.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28606.126 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorPager", "BlazorPager\BlazorPager.csproj", "{97B2CCFC-A7AE-42EF-BCA9-4DF71E8CC92C}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{EA283B01-F23B-4D60-A791-A43DC58C5145}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorComponents", "Demo\RazorComponents\RazorComponents.csproj", "{E8C35A13-6B1C-499A-B391-183650D75468}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorHosted.Server", "Demo\BlazorHosted\BlazorHosted.Server\BlazorHosted.Server.csproj", "{187A947B-ED6B-453F-8EEF-BB6C5C607A3E}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorHosted.Client", "Demo\BlazorHosted\BlazorHosted.Client\BlazorHosted.Client.csproj", "{73A76923-007A-41A1-8A4F-537022831963}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorHosted.Shared", "Demo\BlazorHosted\BlazorHosted.Shared\BlazorHosted.Shared.csproj", "{577C5086-ADC5-4DEA-8FC2-3C404AEDFBF6}" 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlazorHosted", "BlazorHosted", "{72DE1447-0E4A-4689-9DEF-82CDE3904023}" 19 | EndProject 20 | Global 21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 22 | Debug|Any CPU = Debug|Any CPU 23 | Release|Any CPU = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {97B2CCFC-A7AE-42EF-BCA9-4DF71E8CC92C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {97B2CCFC-A7AE-42EF-BCA9-4DF71E8CC92C}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {97B2CCFC-A7AE-42EF-BCA9-4DF71E8CC92C}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {97B2CCFC-A7AE-42EF-BCA9-4DF71E8CC92C}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {E8C35A13-6B1C-499A-B391-183650D75468}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {E8C35A13-6B1C-499A-B391-183650D75468}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {E8C35A13-6B1C-499A-B391-183650D75468}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {E8C35A13-6B1C-499A-B391-183650D75468}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {187A947B-ED6B-453F-8EEF-BB6C5C607A3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {187A947B-ED6B-453F-8EEF-BB6C5C607A3E}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {187A947B-ED6B-453F-8EEF-BB6C5C607A3E}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {187A947B-ED6B-453F-8EEF-BB6C5C607A3E}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {73A76923-007A-41A1-8A4F-537022831963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {73A76923-007A-41A1-8A4F-537022831963}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {73A76923-007A-41A1-8A4F-537022831963}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {73A76923-007A-41A1-8A4F-537022831963}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {577C5086-ADC5-4DEA-8FC2-3C404AEDFBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {577C5086-ADC5-4DEA-8FC2-3C404AEDFBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {577C5086-ADC5-4DEA-8FC2-3C404AEDFBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {577C5086-ADC5-4DEA-8FC2-3C404AEDFBF6}.Release|Any CPU.Build.0 = Release|Any CPU 46 | EndGlobalSection 47 | GlobalSection(SolutionProperties) = preSolution 48 | HideSolutionNode = FALSE 49 | EndGlobalSection 50 | GlobalSection(NestedProjects) = preSolution 51 | {E8C35A13-6B1C-499A-B391-183650D75468} = {EA283B01-F23B-4D60-A791-A43DC58C5145} 52 | {187A947B-ED6B-453F-8EEF-BB6C5C607A3E} = {72DE1447-0E4A-4689-9DEF-82CDE3904023} 53 | {73A76923-007A-41A1-8A4F-537022831963} = {72DE1447-0E4A-4689-9DEF-82CDE3904023} 54 | {577C5086-ADC5-4DEA-8FC2-3C404AEDFBF6} = {72DE1447-0E4A-4689-9DEF-82CDE3904023} 55 | {72DE1447-0E4A-4689-9DEF-82CDE3904023} = {EA283B01-F23B-4D60-A791-A43DC58C5145} 56 | EndGlobalSection 57 | GlobalSection(ExtensibilityGlobals) = postSolution 58 | SolutionGuid = {AAAB50BB-53D3-4B84-AACC-C45AF38ED870} 59 | EndGlobalSection 60 | EndGlobal 61 | -------------------------------------------------------------------------------- /Demo/RazorComponents/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /Demo/RazorComponents/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/BlazorHosted/BlazorHosted.Client/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/RazorComponents/Components/Pages/Inputbox.razor: -------------------------------------------------------------------------------- 1 | @page "/inputbox" 2 | @page "/inputbox/{page:int}" 3 | @using RazorComponents.Services 4 | @using X.PagedList; 5 | @using Webdiyer.AspNetCore; 6 | @using Microsoft.AspNetCore.Components.RenderTree; 7 | 8 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 9 | @inject WeatherForecastService ForecastService 10 | 11 |

BlazorPager demo: using input box

12 | 13 | 14 | @if (forecasts == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var forecast in forecasts) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | } 39 | 40 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
41 | 70 | } 71 | 72 | @functions { 73 | IPagedList forecasts; 74 | 75 | BlazorPager blazorPager; 76 | 77 | string RoutePattern => "inputbox/{0}"; 78 | 79 | [Parameter] 80 | int Page { get; set; } = 1; 81 | 82 | int TotalItemCount { get; set; } 83 | 84 | int PageSize { get; set; } = 5; 85 | 86 | int inputPageIndex { get; set; } 87 | 88 | 89 | protected override async Task OnInitAsync() 90 | { 91 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now, Page, PageSize); 92 | TotalItemCount = forecasts.TotalItemCount; 93 | inputPageIndex = Page; 94 | } 95 | 96 | 97 | void RenderPagerInfo(RenderTreeBuilder builder) 98 | { 99 | var seq = 0; 100 | builder.OpenElement(seq, "li"); 101 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 102 | builder.OpenElement(++seq, "a"); 103 | builder.AddAttribute(++seq, "class", "page-link"); 104 | builder.AddAttribute(++seq, "tabindex", "-1"); 105 | builder.AddContent(++seq, "Page:" + blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 106 | builder.CloseElement(); 107 | builder.CloseElement(); 108 | } 109 | 110 | async void ChangePage(int pageIndex) 111 | { 112 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now, pageIndex, PageSize); 113 | StateHasChanged(); 114 | } 115 | 116 | void GoToPage() 117 | { 118 | blazorPager.GoToPage(inputPageIndex); 119 | } 120 | 121 | } 122 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Pages/Inputbox.razor: -------------------------------------------------------------------------------- 1 | @page "/inputbox" 2 | @page "/inputbox/{page:int}" 3 | @using BlazorHosted.Shared; 4 | @inject HttpClient Http 5 | @using X.PagedList; 6 | @using Webdiyer.AspNetCore; 7 | @using Microsoft.AspNetCore.Components.RenderTree; 8 | 9 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 10 | 11 |

BlazorPager demo: using input box

12 | 13 | 14 | @if (forecasts == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var forecast in forecasts) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | } 39 | 40 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
41 | 70 | } 71 | 72 | @functions { 73 | IPagedList forecasts; 74 | 75 | BlazorPager blazorPager; 76 | 77 | string RoutePattern => "inputbox/{0}"; 78 | 79 | [Parameter] 80 | int Page { get; set; } = 1; 81 | 82 | int TotalItemCount { get; set; } 83 | 84 | int PageSize { get; set; } = 5; 85 | 86 | int inputPageIndex { get; set; } 87 | 88 | async Task GetForecastsData(int pageIndex) 89 | { 90 | var data = await Http.GetJsonAsync>("api/SampleData/WeatherForecasts?pageIndex=" + pageIndex + "&pagesize=" + PageSize); 91 | forecasts = new StaticPagedList(data.Items,pageIndex,data.MetaData.PageSize,data.MetaData.TotalItemCount); 92 | TotalItemCount = forecasts.TotalItemCount; 93 | } 94 | 95 | protected override async Task OnInitAsync() 96 | { 97 | await GetForecastsData(Page); 98 | inputPageIndex = Page; 99 | } 100 | 101 | 102 | void RenderPagerInfo(RenderTreeBuilder builder) 103 | { 104 | var seq = 0; 105 | builder.OpenElement(seq, "li"); 106 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 107 | builder.OpenElement(++seq, "a"); 108 | builder.AddAttribute(++seq, "class", "page-link"); 109 | builder.AddAttribute(++seq, "tabindex", "-1"); 110 | builder.AddContent(++seq, "Page:" + blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 111 | builder.CloseElement(); 112 | builder.CloseElement(); 113 | } 114 | 115 | async void ChangePage(int pageIndex) 116 | { 117 | await GetForecastsData(pageIndex); 118 | StateHasChanged(); 119 | } 120 | 121 | void GoToPage() 122 | { 123 | blazorPager.GoToPage(inputPageIndex); 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @page "/fetchdata/{page:int}" 3 | @using RazorComponents.Services 4 | @using X.PagedList; 5 | @using Webdiyer.AspNetCore; 6 | @using Microsoft.AspNetCore.Components.RenderTree; 7 | 8 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 9 | @inject WeatherForecastService ForecastService 10 | 11 |

Weather forecast

12 | 13 |

This component demonstrates fetching data from the server.

14 | 15 | @if (forecasts == null) 16 | { 17 |

Loading...

18 | } 19 | else 20 | { 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | @foreach (var forecast in forecasts) 32 | { 33 | 34 | 35 | 36 | 37 | 38 | 39 | } 40 | 41 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
42 | 78 | } 79 | 80 | @functions { 81 | IPagedList forecasts; 82 | 83 | BlazorPager blazorPager; 84 | 85 | string RoutePattern => "fetchdata/{0}"; 86 | 87 | [Parameter] 88 | int Page { get; set; } = 1; 89 | 90 | int TotalItemCount { get; set; } 91 | 92 | int PageSize { get; set; } = 5; 93 | 94 | 95 | protected override async Task OnInitAsync() 96 | { 97 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now, Page, PageSize); 98 | TotalItemCount = forecasts.TotalItemCount; 99 | } 100 | 101 | 102 | void RenderPagerInfo(RenderTreeBuilder builder) 103 | { 104 | var seq = 0; 105 | builder.OpenElement(seq, "li"); 106 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 107 | builder.OpenElement(++seq, "a"); 108 | builder.AddAttribute(++seq, "class", "page-link"); 109 | builder.AddAttribute(++seq, "tabindex", "-1"); 110 | builder.AddContent(++seq, "Page:"+blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 111 | builder.CloseElement(); 112 | builder.CloseElement(); 113 | } 114 | 115 | async void ChangePage(int pageIndex) 116 | { 117 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now, pageIndex, PageSize); 118 | StateHasChanged(); 119 | } 120 | 121 | void GoToPage(int pageIndex) 122 | { 123 | blazorPager.GoToPage(pageIndex); 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Pages/FetchData.cshtml: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @page "/fetchdata/{page:int}" 3 | @using BlazorHosted.Shared; 4 | @inject HttpClient Http 5 | @using X.PagedList; 6 | @using Webdiyer.AspNetCore; 7 | @using Microsoft.AspNetCore.Components.RenderTree; 8 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 9 | 10 |

Weather forecast

11 | 12 |

This component demonstrates fetching data from the server.

13 | 14 | @if (forecasts == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var forecast in forecasts) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | } 39 | 40 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
41 | 42 | 78 | } 79 | 80 | @functions { 81 | 82 | IPagedList forecasts; 83 | 84 | BlazorPager blazorPager; 85 | 86 | string RoutePattern => "fetchdata/{0}"; 87 | 88 | [Parameter] 89 | int Page { get; set; } = 1; 90 | 91 | int TotalItemCount { get; set; } 92 | 93 | int PageSize { get; set; } = 5; 94 | 95 | 96 | protected override async Task OnInitAsync() 97 | { 98 | await GetForecastsData(Page); 99 | } 100 | 101 | async Task GetForecastsData(int pageIndex) 102 | { 103 | var data = await Http.GetJsonAsync>("api/SampleData/WeatherForecasts?pageIndex=" + pageIndex + "&pagesize=" + PageSize); 104 | forecasts = new StaticPagedList(data.Items,pageIndex,data.MetaData.PageSize,data.MetaData.TotalItemCount); 105 | TotalItemCount = forecasts.TotalItemCount; 106 | } 107 | 108 | void RenderPagerInfo(RenderTreeBuilder builder) 109 | { 110 | var seq = 0; 111 | builder.OpenElement(seq, "li"); 112 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 113 | builder.OpenElement(++seq, "a"); 114 | builder.AddAttribute(++seq, "class", "page-link"); 115 | builder.AddAttribute(++seq, "tabindex", "-1"); 116 | builder.AddContent(++seq, "Page:"+blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 117 | builder.CloseElement(); 118 | builder.CloseElement(); 119 | } 120 | 121 | async void ChangePage(int pageIndex) 122 | { 123 | await GetForecastsData(pageIndex); 124 | StateHasChanged(); 125 | } 126 | 127 | void GoToPage(int pageIndex) 128 | { 129 | blazorPager.GoToPage(pageIndex); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Pages/Search.razor: -------------------------------------------------------------------------------- 1 | @page "/search" 2 | @page "/search/{page:int}" 3 | @using BlazorHosted.Shared; 4 | @inject HttpClient Http 5 | @using X.PagedList; 6 | @using Webdiyer.AspNetCore; 7 | @using Microsoft.AspNetCore.Components.RenderTree; 8 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 9 | 10 |

BlazorPager demo: search and pagination

11 | @if (Orders == null) 12 | { 13 |

Loading...

14 | } 15 | else 16 | { 17 |
18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach (var o in Orders) 33 | { 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | } 42 | 43 |
OrderIdOrderDateCustomerIdCompanyNameEmployeeName
@o.OrderID@o.OrderDate.ToShortDateString()@o.CustomerID@o.CompanyName@o.EmployeeName
44 | 74 | } 75 | 76 | 77 | @functions{ 78 | [Parameter] 79 | private int Page { get; set; } = 1; 80 | 81 | BlazorPager blazorPager; 82 | 83 | //company name to bind 84 | string CompanyName { get; set; } 85 | //company name to search 86 | string _compName = null; 87 | 88 | string SelectedPage 89 | { 90 | get => Page.ToString(); 91 | set { blazorPager.GoToPage(int.Parse(value)); } 92 | } 93 | int PageSize = 5; 94 | 95 | IPagedList Orders { get; set; } 96 | 97 | protected override async Task OnInitAsync() 98 | { 99 | await GetOrders(Page, PageSize); 100 | } 101 | 102 | void RenderPagerInfo(RenderTreeBuilder builder) 103 | { 104 | var seq = 0; 105 | builder.OpenElement(seq, "li"); 106 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 107 | builder.OpenElement(++seq, "a"); 108 | builder.AddAttribute(++seq, "class", "page-link"); 109 | builder.AddAttribute(++seq, "tabindex", "-1"); 110 | builder.AddContent(++seq, "Page:" + blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 111 | builder.CloseElement(); 112 | builder.CloseElement(); 113 | } 114 | 115 | async void ChangePage(int pageIndex) 116 | { 117 | await GetOrders(pageIndex, PageSize); 118 | SelectedPage = pageIndex.ToString(); 119 | StateHasChanged(); 120 | } 121 | 122 | async Task GetOrders(int pageIndex, int pageSize) 123 | { 124 | var data = await Http.GetJsonAsync>($"api/SampleData/Orders?companyName={_compName}&pageIndex={pageIndex}&pagesize={PageSize}"); 125 | Orders = new StaticPagedList(data.Items, pageIndex, data.MetaData.PageSize, data.MetaData.TotalItemCount); 126 | } 127 | 128 | async void SearchOrders(UIMouseEventArgs e) 129 | { 130 | _compName = CompanyName; 131 | await GetOrders(1, PageSize); 132 | blazorPager.GoToPage(1); 133 | StateHasChanged(); 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/Pages/Search.razor: -------------------------------------------------------------------------------- 1 | @page "/search" 2 | @page "/search/{page:int}" 3 | @using RazorComponents.Services 4 | @using X.PagedList; 5 | @using Webdiyer.AspNetCore; 6 | @using Microsoft.AspNetCore.Components.RenderTree; 7 | @using Microsoft.AspNetCore.Hosting; 8 | @using System.IO; 9 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 10 | @inject IWebHostEnvironment Env 11 | 12 |

BlazorPager demo: search and pagination

13 |
14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @foreach (var o in Orders) 29 | { 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | 39 |
OrderIdOrderDateCustomerIdCompanyNameEmployeeName
@o.OrderID@o.OrderDate.ToShortDateString()@o.CustomerID@o.CompanyName@o.EmployeeName
40 | 78 | 79 | 80 | @functions{ 81 | [Parameter] 82 | private int Page { get; set; } = 1; 83 | 84 | BlazorPager blazorPager; 85 | 86 | //company name to bind 87 | string CompanyName { get; set; } 88 | //company name to search 89 | string _compName=null; 90 | 91 | string SelectedPage 92 | { 93 | get => Page.ToString(); 94 | set { blazorPager.GoToPage(int.Parse(value)); } 95 | } 96 | int _pageSize = 5; 97 | int PageSize { get=>_pageSize; set { _pageSize = value;GetOrders(Page, value);} } 98 | 99 | IPagedList Orders { get; set; } 100 | 101 | protected override void OnInit() 102 | { 103 | GetOrders(Page, PageSize); 104 | } 105 | 106 | void RenderPagerInfo(RenderTreeBuilder builder) 107 | { 108 | var seq = 0; 109 | builder.OpenElement(seq, "li"); 110 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 111 | builder.OpenElement(++seq, "a"); 112 | builder.AddAttribute(++seq, "class", "page-link"); 113 | builder.AddAttribute(++seq, "tabindex", "-1"); 114 | builder.AddContent(++seq, "Page:" + blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 115 | builder.CloseElement(); 116 | builder.CloseElement(); 117 | } 118 | 119 | void ChangePage(int pageIndex) 120 | { 121 | GetOrders(pageIndex, PageSize); 122 | SelectedPage = pageIndex.ToString(); 123 | } 124 | 125 | void GetOrders(int pageIndex, int pageSize) 126 | { 127 | var path = Path.Combine(Env.WebRootPath, "orders.json"); 128 | var ods=Newtonsoft.Json.JsonConvert.DeserializeObject(File.ReadAllText(path)); 129 | 130 | Orders = ods.Where(o=>_compName==null||o.CompanyName.Contains(_compName)).ToPagedList(pageIndex, pageSize); 131 | StateHasChanged(); 132 | } 133 | 134 | void SearchOrders(UIMouseEventArgs e) 135 | { 136 | _compName = CompanyName; 137 | GetOrders(1, PageSize); 138 | blazorPager.GoToPage(1); 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /Demo/RazorComponents/Components/Pages/DynamicPageSize.razor: -------------------------------------------------------------------------------- 1 | @page "/dynamicpagesize" 2 | @page "/dynamicpagesize/{page:int}" 3 | @using RazorComponents.Services 4 | @using X.PagedList; 5 | @using Webdiyer.AspNetCore; 6 | @using Microsoft.AspNetCore.Components.RenderTree; 7 | @using Microsoft.AspNetCore.Hosting; 8 | @using System.IO; 9 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 10 | @inject IWebHostEnvironment Env 11 | 12 |

BlazorPager demo: Dynamic Page size

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var o in Orders) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
OrderIdOrderDateCustomerIdCompanyNameEmployeeName
@o.OrderID@o.OrderDate.ToShortDateString()@o.CustomerID@o.CompanyName@o.EmployeeName
37 | 81 | 82 | 83 | @functions{ 84 | [Parameter] 85 | private int Page { get; set; } = 1; 86 | 87 | BlazorPager blazorPager; 88 | 89 | string SelectedPage 90 | { 91 | get => Page.ToString(); 92 | set { blazorPager.GoToPage(int.Parse(value)); } 93 | } 94 | int _pageSize = 5; 95 | int PageSize { get=>_pageSize; set { _pageSize = value;GetOrders(Page, value); StateHasChanged(); } } 96 | 97 | void ChangePageSize(int pageSize) 98 | { 99 | PageSize = pageSize; 100 | GetOrders(Page, pageSize); 101 | } 102 | 103 | IPagedList Orders { get; set; } 104 | 105 | protected override void OnInit() 106 | { 107 | GetOrders(Page, PageSize); 108 | } 109 | 110 | void RenderPagerInfo(RenderTreeBuilder builder) 111 | { 112 | var seq = 0; 113 | builder.OpenElement(seq, "li"); 114 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 115 | builder.OpenElement(++seq, "a"); 116 | builder.AddAttribute(++seq, "class", "page-link"); 117 | builder.AddAttribute(++seq, "tabindex", "-1"); 118 | builder.AddContent(++seq, "Page:" + blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 119 | builder.CloseElement(); 120 | builder.CloseElement(); 121 | } 122 | 123 | void ChangePage(int pageIndex) 124 | { 125 | GetOrders(pageIndex, PageSize); 126 | SelectedPage = pageIndex.ToString(); 127 | } 128 | 129 | void GetOrders(int pageIndex, int pageSize) 130 | { 131 | var path = Path.Combine(Env.WebRootPath, "orders.json"); 132 | var ods=Newtonsoft.Json.JsonConvert.DeserializeObject(File.ReadAllText(path)); 133 | 134 | Orders = ods.ToPagedList(pageIndex, pageSize); 135 | StateHasChanged(); 136 | } 137 | 138 | } 139 | -------------------------------------------------------------------------------- /Demo/BlazorHosted/BlazorHosted.Client/Pages/DynamicPageSize.razor: -------------------------------------------------------------------------------- 1 | @page "/dynamicpagesize" 2 | @page "/dynamicpagesize/{page:int}" 3 | @inject HttpClient Http 4 | @using X.PagedList; 5 | @using BlazorHosted.Shared; 6 | @using Webdiyer.AspNetCore; 7 | @using Microsoft.AspNetCore.Components.RenderTree; 8 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 9 | 10 |

BlazorPager demo: Dynamic Page size

11 | 12 | @if (forecasts == null) 13 | { 14 |

Loading...

15 | } 16 | else 17 | { 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @foreach (var forecast in forecasts) 29 | { 30 | 31 | 32 | 33 | 34 | 35 | 36 | } 37 | 38 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
39 | 83 | } 84 | 85 | @functions{ 86 | [Parameter] 87 | private int Page { get; set; } = 1; 88 | 89 | BlazorPager blazorPager; 90 | 91 | string SelectedPage 92 | { 93 | get => Page.ToString(); 94 | set { blazorPager.GoToPage(int.Parse(value)); } 95 | } 96 | int PageSize = 5; 97 | 98 | IPagedList forecasts; 99 | 100 | async void ChangePageSize(int pageSize) 101 | { 102 | PageSize = pageSize; 103 | await GetForecastsData(Page, pageSize); 104 | StateHasChanged(); 105 | } 106 | 107 | async Task GetForecastsData(int pageIndex, int pageSize) 108 | { 109 | var data = await Http.GetJsonAsync>($"api/SampleData/WeatherForecasts?pageIndex={pageIndex}&pagesize={PageSize}"); 110 | if (data.MetaData.PageCount < pageIndex) 111 | { 112 | blazorPager.GoToPage(data.MetaData.PageCount); 113 | } 114 | else 115 | { 116 | forecasts = new StaticPagedList(data.Items, pageIndex, data.MetaData.PageSize, data.MetaData.TotalItemCount); 117 | } 118 | } 119 | 120 | protected override async Task OnInitAsync() 121 | { 122 | await GetForecastsData(Page, PageSize); 123 | } 124 | 125 | 126 | void RenderPagerInfo(RenderTreeBuilder builder) 127 | { 128 | var seq = 0; 129 | builder.OpenElement(seq, "li"); 130 | builder.AddAttribute(++seq, "class", "page-item disabled mr-3"); 131 | builder.OpenElement(++seq, "a"); 132 | builder.AddAttribute(++seq, "class", "page-link"); 133 | builder.AddAttribute(++seq, "tabindex", "-1"); 134 | builder.AddContent(++seq, "Page:" + blazorPager.CurrentPageIndex + "/" + blazorPager.TotalPageCount); 135 | builder.CloseElement(); 136 | builder.CloseElement(); 137 | } 138 | 139 | async void ChangePage(int pageIndex) 140 | { 141 | await GetForecastsData(pageIndex, PageSize); 142 | StateHasChanged(); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /README_ZH-CN.md: -------------------------------------------------------------------------------- 1 | # BlazorPager | [English](README.md) 2 | 3 | BlazorPager 是一个应用于 Razor Components(即Blazor服务器端) 项目的分页组件,支持Blazor 0.8.0+,目前还在逐步完善中! 4 | 5 | [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Webdiyer/BlazorPager/blob/master/LICENSE) 6 | [![NuGet](https://img.shields.io/nuget/v/BlazorPager.svg)](https://www.nuget.org/packages/BlazorPager/) 7 | 8 | blazorpager demo 9 | 10 | --- 11 | 12 | 13 | ## 开发运行先决条件 ## 14 | 15 | 1. [Visual Studio 2019 RC](https://visualstudio.microsoft.com/) 16 | 2. [.Net Core 3.0 SDK preview 3](https://dotnet.microsoft.com/download/dotnet-core/3.0) 17 | 18 | ## Nuget包 ## 19 | 20 | Nuget包可从 https://www.nuget.org/packages/BlazorPager/ 下载。 21 | 22 | ## 安装 ## 23 | 24 | 可以通过VS的Nuget包管理器界面中搜索并添加 BlazorPager 引用,也可以在VS的Nuget包管理器控制台中输入如下命令安装: 25 | 26 | ``` 27 | Install-Package BlazorPager 28 | ``` 29 | 30 | 或者通过.net core命令行安装: 31 | ``` 32 | dotnet add package BlazorPager 33 | ``` 34 | 35 | ## 使用 ## 36 | 37 | 1. 注册 TagHelper: 38 | 39 | ``` 40 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 41 | ``` 42 | 43 | 2. 如果需要在服务器端代码中引用 BlazorPager,请引入如下命名空间: 44 | 45 | ``` 46 | @using Webdiyer.AspNetCore; 47 | ``` 48 | 49 | 3. 一个最简单的 BlazorPager 使用示例(不获取和显示数据): 50 | 51 | 52 | ``` 53 | @page "/" 54 | @page "/index/{page:int}" 55 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 56 | 57 | 58 | 59 | @functions{ 60 | [Parameter] 61 | private int Page { get; set; } 62 | 63 | } 64 | ``` 65 | 66 | 更多使用示例,请查看Demo文件夹下的示例项目。 67 | 68 | --- 69 | 70 | ## 属性: ## 71 | 72 | --- 73 | ##### TagName 74 | 75 | 分页控件html容器标签名,默认为div。 76 | 77 | 78 | 79 | --- 80 | ##### PageSize 81 | 82 | 获取或设置每页显示的记录数。 83 | 84 | 85 | 86 | --- 87 | ##### InitPageIndex 88 | 89 | 获取或设置分页组件初始化时的当前页索引。 90 | 91 | 92 | 93 | --- 94 | ##### TotalItemCount 95 | 96 | 获取或设置要分页的数据总数。 97 | 98 | 99 | 100 | --- 101 | ##### NumericPagerItemTextFormatString 102 | 103 | 获取或设置数字页索引文本格式化字符串。 104 | 105 | 106 | 107 | --- 108 | ##### CurrentPagerItemTextFormatString 109 | 110 | 获取或设置当前页数字页索引文本格式化字符串。 111 | 112 | 113 | 114 | --- 115 | ##### RoutePattern 116 | 117 | 获取或设置用于生成分页链接的路由模板,该值必须包含一个“{0}”占位符。 118 | 119 | 120 | 121 | --- 122 | ##### NumericPagerItemCount 123 | 124 | 获取或设置要显示的数字页索引分页按钮的数量。 125 | 126 | 127 | 128 | --- 129 | ##### OnPageChanged 130 | 131 | 获取或设置分页事件处理程序。 132 | 133 | 134 | 135 | --- 136 | ##### PagerItemCssClass 137 | 138 | 获取或设置要应用于所有分页按钮上的CSS样式类名。 139 | 140 | 141 | 142 | --- 143 | ##### MorePagerItemCssClass 144 | 145 | 获取或设置应用于更多页分页导航按钮的CSS样式类。 146 | 147 | 148 | 149 | --- 150 | ##### NumericPagerItemCssClass 151 | 152 | 获取或设置要应用于数字页索引分页按钮上的CSS样式类名。 153 | 154 | 155 | 156 | --- 157 | ##### NavigationPagerItemCssClass 158 | 159 | 获取或设置应用于分页导航按钮的CSS样式类。 160 | 161 | 162 | 163 | --- 164 | ##### CurrentPagerItemCssClass 165 | 166 | 获取或设置要应用于当前页索引分页按钮上的CSS样式类名。 167 | 168 | 169 | 170 | --- 171 | ##### DisabledPagerItemCssClass 172 | 173 | 获取或设置应用于已禁用的分页元素的CSS样式类。 174 | 175 | 176 | 177 | --- 178 | ##### AutoHide 179 | 180 | 获取或设置一个值,该值指示当总页数只有一页时,是否自动隐藏分页组件。 181 | 182 | 183 | 184 | --- 185 | ##### ShowNumericPagerItems 186 | 187 | 获取或设置一个值,该值指示是否显示数字页索引分页按钮。 188 | 189 | 190 | 191 | --- 192 | ##### ShowMorePagerItems 193 | 194 | 获取或设置一个值,该值指示是否显示更多页分页导航按钮。 195 | 196 | 197 | 198 | --- 199 | ##### ShowFirstLast 200 | 201 | 获取或设置一个值,该值指示是否显示首页和尾页分页导航按钮。 202 | 203 | 204 | 205 | --- 206 | ##### ShowPrevNext 207 | 208 | 获取或设置一个值,该值指示是否显示上一页和下一页分页导航按钮。 209 | 210 | 211 | 212 | --- 213 | ##### FirstPageText 214 | 215 | 获取或设置首页分页按钮上显示的文本。 216 | 217 | 218 | 219 | --- 220 | ##### PrevPageText 221 | 222 | 获取或设置上一页分页按钮上显示的文本。 223 | 224 | 225 | 226 | --- 227 | ##### NextPageText 228 | 229 | 获取或设置下一页分页按钮上显示的文本。 230 | 231 | 232 | 233 | --- 234 | ##### LastPageText 235 | 236 | 获取或设置最后一页分页按钮上显示的文本。 237 | 238 | 239 | 240 | --- 241 | ##### MorePageText 242 | 243 | 获取或设置更多页按钮上显示的文本。 244 | 245 | 246 | 247 | --- 248 | ##### PagerItemContainerTagName 249 | 250 | 获取或设置分页元素的父元素的标签名,默认值为null,意即没有父元素。 251 | 252 | 253 | 254 | --- 255 | ##### PagerItemContainerCssClass 256 | 257 | 获取或设置要应用于分页元素父元素的CSS样式类。 258 | 259 | 260 | 261 | --- 262 | ##### NumericPagerItemContainerTagName 263 | 264 | 获取或设置数字页索引分页元素的父元素的标签名,默认值为null,意即没有父元素。 265 | 266 | 267 | 268 | --- 269 | ##### NumericPagerItemContainerCssClass 270 | 271 | 获取或设置要应用于数字页索引分页元素父元素的CSS样式类。 272 | 273 | 274 | 275 | --- 276 | ##### CurrentPagerItemContainerTagName 277 | 278 | 获取或设置当前页分页元素的父元素的标签名,默认值为null,意即没有父元素。 279 | 280 | 281 | 282 | --- 283 | ##### CurrentPagerItemContainerCssClass 284 | 285 | 获取或设置要应用于当前页分页元素父元素的CSS样式类。 286 | 287 | 288 | 289 | --- 290 | ##### NavigationPagerItemContainerTagName 291 | 292 | 获取或设置首页、尾页、上页和下页四个分页元素的父元素的标签名,默认值为null,意即没有父元素。 293 | 294 | 295 | 296 | --- 297 | ##### NavigationPagerItemContainerCssClass 298 | 299 | 获取或设置要应用于首页、尾页、上页和下页四个分页元素父元素的CSS样式类。 300 | 301 | 302 | 303 | --- 304 | ##### MorePagerItemContainerTagName 305 | 306 | 获取或设置更多页分页元素的父元素的标签名,默认值为null,意即没有父元素。 307 | 308 | 309 | 310 | --- 311 | ##### MorePagerItemContainerCssClass 312 | 313 | 获取或设置要应用于更多页分页元素父元素的CSS样式类。 314 | 315 | 316 | 317 | --- 318 | ##### DisabledPagerItemContainerTagName 319 | 320 | 获取或设置被禁用的分页元素的父元素的标签名,默认值为null,意即没有父元素。 321 | 322 | 323 | 324 | > 若当前页为第一页时,则首页和上一页分页导航按钮将被禁用;若当前页为最后一页,则尾页和下一页分页导航按钮将被禁用; 325 | 326 | 327 | 328 | --- 329 | ##### DisabledPagerItemContainerCssClass 330 | 331 | 获取或设置要应用于被禁用的分页元素父元素的CSS样式类。 332 | 333 | 334 | 335 | --- 336 | ##### RenderAfterBeginTag 337 | 338 | 获取或设置一个用于在分页组件开始标签后写入内容的委托。 339 | 340 | 341 | 342 | --- 343 | ##### RenderBeforeEndTag 344 | 345 | 获取或设置一个用于在分页组件结束标签前写入内容的委托。 346 | 347 | 348 | 349 | --- 350 | ##### CurrentPageIndex 351 | 352 | 获取当前页索引。 353 | 354 | 355 | 356 | --- 357 | ##### TotalPageCount 358 | 359 | 获取要分页数据的总页数。 360 | 361 | 362 | 363 | --- 364 | ## 方法: ## 365 | 366 | --- 367 | 368 | ##### GoToPage(System.Int32) 369 | 370 | 跳转到指定页。 371 | 372 | |Name | Description | 373 | |-----|------| 374 | |pageIndex: |要跳转到的页索引,从1开始。| 375 | 376 | 377 | --- 378 | -------------------------------------------------------------------------------- /BlazorPager/docs/BlazorPagerDoc.zh-CHS.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 应用于 Blazor 和 Razor Components web应用程序中的分页组件。 5 | 6 | 7 | 8 | 9 | 分页控件html容器标签名,默认为div。 10 | 11 | 12 | 13 | 获取当前页索引。 14 | 15 | 16 | 17 | 获取或设置分页组件初始化时的当前页索引。 18 | 19 | 20 | 21 | 获取或设置每页显示的记录数。 22 | 23 | 24 | 获取或设置要分页的数据总数。 25 | 26 | 27 | 获取要分页数据的总页数。 28 | 29 | 30 | 31 | 获取或设置要显示的数字页索引分页按钮的数量。 32 | 33 | 34 | 35 | 36 | 获取或设置一个值,该值指示是否显示上一页和下一页分页导航按钮。 37 | 38 | 39 | 40 | 41 | 获取或设置一个值,该值指示是否显示首页和尾页分页导航按钮。 42 | 43 | 44 | 45 | 46 | 获取或设置一个值,该值指示是否显示数字页索引分页按钮。 47 | 48 | 49 | 50 | 51 | 获取或设置一个值,该值指示是否显示更多页分页导航按钮。 52 | 53 | 54 | 55 | 56 | 获取或设置上一页分页按钮上显示的文本。 57 | 58 | 59 | 60 | 61 | 获取或设置下一页分页按钮上显示的文本。 62 | 63 | 64 | 65 | 66 | 获取或设置首页分页按钮上显示的文本。 67 | 68 | 69 | 70 | 71 | 获取或设置最后一页分页按钮上显示的文本。 72 | 73 | 74 | 75 | 76 | 获取或设置更多页按钮上显示的文本。 77 | 78 | 79 | 80 | 81 | 获取或设置一个值,该值指示当总页数只有一页时,是否自动隐藏分页组件。 82 | 83 | 84 | 85 | 86 | 获取或设置要应用于所有分页按钮上的CSS样式类名。 87 | 88 | 89 | 90 | 91 | 获取或设置要应用于当前页索引分页按钮上的CSS样式类名。 92 | 93 | 94 | 95 | 96 | 获取或设置要应用于数字页索引分页按钮上的CSS样式类名。 97 | 98 | 99 | 100 | 101 | 获取或设置应用于已禁用的分页元素的CSS样式类。 102 | 103 | 104 | 105 | 106 | 获取或设置应用于分页导航按钮的CSS样式类。 107 | 108 | 109 | 110 | 111 | 获取或设置应用于更多页分页导航按钮的CSS样式类。 112 | 113 | 114 | 115 | 116 | 获取或设置数字页索引文本格式化字符串。 117 | 118 | 119 | 120 | 121 | 获取或设置当前页数字页索引文本格式化字符串。 122 | 123 | 124 | 125 | 126 | 获取或设置用于生成分页链接的路由模板,该值必须包含一个“{0}”占位符。 127 | 128 | 129 | 130 | 131 | 获取或设置分页事件处理程序。 132 | 133 | 134 | 135 | 136 | 获取或设置分页元素的父元素的标签名,默认值为null,意即没有父元素。 137 | 138 | 139 | 140 | 141 | 获取或设置要应用于分页元素父元素的CSS样式类。 142 | 143 | 144 | 145 | 146 | 获取或设置数字页索引分页元素的父元素的标签名,默认值为null,意即没有父元素。 147 | 148 | 149 | 150 | 151 | 获取或设置要应用于数字页索引分页元素父元素的CSS样式类。 152 | 153 | 154 | 155 | 156 | 获取或设置当前页分页元素的父元素的标签名,默认值为null,意即没有父元素。 157 | 158 | 159 | 160 | 161 | 获取或设置要应用于当前页分页元素父元素的CSS样式类。 162 | 163 | 164 | 165 | 166 | 获取或设置首页、尾页、上页和下页四个分页元素的父元素的标签名,默认值为null,意即没有父元素。 167 | 168 | 169 | 170 | 171 | 获取或设置要应用于首页、尾页、上页和下页四个分页元素父元素的CSS样式类。 172 | 173 | 174 | 175 | 176 | 获取或设置更多页分页元素的父元素的标签名,默认值为null,意即没有父元素。 177 | 178 | 179 | 180 | 181 | 获取或设置要应用于更多页分页元素父元素的CSS样式类。 182 | 183 | 184 | 185 | 186 | 获取或设置被禁用的分页元素的父元素的标签名,默认值为null,意即没有父元素。 187 | 188 | 189 | 若当前页为第一页时,则首页和上一页分页导航按钮将被禁用;若当前页为最后一页,则尾页和下一页分页导航按钮将被禁用; 190 | 191 | 192 | 193 | 194 | 获取或设置要应用于被禁用的分页元素父元素的CSS样式类。 195 | 196 | 197 | 198 | 199 | 获取或设置一个用于在分页组件开始标签后写入内容的委托。 200 | 201 | 202 | 203 | 204 | 获取或设置一个用于在分页组件结束标签前写入内容的委托。 205 | 206 | 207 | 208 | 209 | 跳转到指定页。 210 | 211 | 要跳转到的页索引,从1开始。 212 | 213 | 214 | 215 | 重写 ComponentBase.OnInit 方法。 216 | 217 | 218 | 219 | 220 | 重写 ComponentBase.OnParametersSet 方法。 221 | 222 | 223 | 224 | 225 | 重写 ComponentBase.BuildRenderTree 方法,执行组件呈现逻辑。 226 | 227 | 一个接收呈现输出的 RenderTreeBuilder 对象。 228 | 229 | 230 | 231 | 重写 ComponentBase.SetParametersAsync 方法。 232 | 233 | 要应用的参数集合。 234 | 235 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | /BlazorPager/docs/Webdiyer.AspNetCore.BlazorPager.xml 332 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BlazorPager | [简体中文](README_ZH-CN.md) 2 | 3 | BlazorPager is a Pagination component for Blazor and Razor Components application, it supports Blazor version 0.8.0+ and still under active development. 4 | 5 | [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Webdiyer/BlazorPager/blob/master/LICENSE) 6 | [![NuGet](https://img.shields.io/nuget/v/BlazorPager.svg)](https://www.nuget.org/packages/BlazorPager/) 7 | 8 | 9 | blazorpager demo 10 | 11 | --- 12 | ## Prerequisites: ## 13 | 14 | 1. [Visual Studio 2019 RC](https://visualstudio.microsoft.com/) 15 | 2. [.Net Core 3.0 SDK preview 3](https://dotnet.microsoft.com/download/dotnet-core/3.0) 16 | 17 | ## Nuget Package: ## 18 | Nuget packages can be found at: https://www.nuget.org/packages/BlazorPager/ 19 | 20 | ## Installation: ## 21 | 22 | Install via Visual Studio Package manager console: 23 | 24 | ``` 25 | Install-Package BlazorPager 26 | ``` 27 | or via .NET Core command-line interface (CLI) tools: 28 | ``` 29 | dotnet add package BlazorPager 30 | ``` 31 | ## Usage ## 32 | 33 | 1. Register tag helper: 34 | 35 | ``` 36 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 37 | ``` 38 | 39 | 2. Add namespace If you need to reference BlazorPager in your server side code: 40 | 41 | ``` 42 | @using Webdiyer.AspNetCore; 43 | ``` 44 | 45 | 3. A simple BlazorPager pagination sample without displaying any data actually: 46 | 47 | 48 | ``` 49 | @page "/" 50 | @page "/index/{page:int}" 51 | @addTagHelper *,Webdiyer.AspNetCore.BlazorPager 52 | 53 | 54 | 55 | @functions{ 56 | [Parameter] 57 | private int Page { get; set; } 58 | 59 | } 60 | ``` 61 | 62 | For more advanced usages, please view the sample projects under the Demo folder. 63 | 64 | --- 65 | 66 | ## Properties: ## 67 | 68 | --- 69 | ##### TagName 70 | 71 | Gets or sets the HTML tag name for the container element of the pager, default value is div. 72 | 73 | 74 | 75 | --- 76 | ##### PageSize 77 | 78 | Gets or sets the number of data items that are displayed for each page of data. 79 | 80 | 81 | 82 | --- 83 | ##### InitPageIndex 84 | 85 | Gets or sets the current page index value when the pager component initialized first time. 86 | 87 | 88 | 89 | --- 90 | ##### TotalItemCount 91 | 92 | Gets or sets the total number of data items that are available for paging. 93 | 94 | 95 | 96 | --- 97 | ##### NumericPagerItemTextFormatString 98 | 99 | Gets or sets the format string for all numeric pager items. 100 | 101 | 102 | 103 | --- 104 | ##### CurrentPagerItemTextFormatString 105 | 106 | Gets or sets the format string for the current page number. 107 | 108 | 109 | 110 | --- 111 | ##### RoutePattern 112 | 113 | Gets or sets the route template that the pager component used to generate pagination links, it must contains a placeholder "{0}" for page index. 114 | 115 | 116 | 117 | --- 118 | ##### NumericPagerItemCount 119 | 120 | Gets or sets the maximum number of the numeric pager items to be displayed. 121 | 122 | 123 | 124 | --- 125 | ##### OnPageChanged 126 | 127 | Gets or sets an action that been invoked when page index changed. 128 | 129 | 130 | 131 | --- 132 | ##### PagerItemCssClass 133 | 134 | Gets or sets the css class to be applied to every pager items. 135 | 136 | 137 | 138 | --- 139 | ##### MorePagerItemCssClass 140 | 141 | Gets or sets the css class to be applied to the more pager items. 142 | 143 | 144 | 145 | --- 146 | ##### NumericPagerItemCssClass 147 | 148 | Gets or sets the css class to be applied to the numeric pager items. 149 | 150 | 151 | 152 | --- 153 | ##### NavigationPagerItemCssClass 154 | 155 | Gets or sets the css class to be applied to the first, previous, next and last page pager items. 156 | 157 | 158 | 159 | --- 160 | ##### CurrentPagerItemCssClass 161 | 162 | Gets or sets the css class to be applied to the current page pager item. 163 | 164 | 165 | 166 | --- 167 | ##### DisabledPagerItemCssClass 168 | 169 | Gets or sets the css class to be applied to the disabled navigation pager items. 170 | 171 | 172 | 173 | --- 174 | ##### AutoHide 175 | 176 | Gets or sets a value indicating whether MvcPager should be hidden if there's only one page of data. 177 | 178 | 179 | 180 | --- 181 | ##### ShowNumericPagerItems 182 | 183 | Gets or sets a value indicating whether the numeric pager items should be displayed. 184 | 185 | 186 | 187 | --- 188 | ##### ShowMorePagerItems 189 | 190 | Gets or sets a value indicating whether the more pager items should be displayed. 191 | 192 | 193 | 194 | --- 195 | ##### ShowFirstLast 196 | 197 | Gets or sets a value indicating whether the first page and the last page pager items should be displayed. 198 | 199 | 200 | 201 | --- 202 | ##### ShowPrevNext 203 | 204 | Gets or sets a value indicating whether the previous page and the next page pager items should be displayed. 205 | 206 | 207 | 208 | --- 209 | ##### FirstPageText 210 | 211 | Gets or sets the text displayed for the first page button. 212 | 213 | 214 | 215 | --- 216 | ##### PrevPageText 217 | 218 | Gets or sets the text displayed for the previous page pager item. 219 | 220 | 221 | 222 | --- 223 | ##### NextPageText 224 | 225 | Gets or sets the text displayed for the next page pager item. 226 | 227 | 228 | 229 | --- 230 | ##### LastPageText 231 | 232 | Gets or sets the text displayed for the last page pager item. 233 | 234 | 235 | 236 | --- 237 | ##### MorePageText 238 | 239 | Gets or sets the text displayed for the more pager items. 240 | 241 | 242 | 243 | --- 244 | ##### PagerItemContainerTagName 245 | 246 | Gets or sets the tag name of the container element that wraps every pager items, default value is null. 247 | 248 | 249 | 250 | --- 251 | ##### PagerItemContainerCssClass 252 | 253 | Gets or sets the css class to be applied to the container element of pager items. 254 | 255 | 256 | 257 | --- 258 | ##### NumericPagerItemContainerTagName 259 | 260 | Gets or sets the tag name of the container element that wraps every numeric pager items, default value is null. 261 | 262 | 263 | 264 | --- 265 | ##### NumericPagerItemContainerCssClass 266 | 267 | Gets or sets the css class to be applied to the container element of numeric pager items. 268 | 269 | 270 | 271 | --- 272 | ##### CurrentPagerItemContainerTagName 273 | 274 | Gets or sets the tag name of the container element that wraps current pager item, default value is null. 275 | 276 | 277 | 278 | --- 279 | ##### CurrentPagerItemContainerCssClass 280 | 281 | Gets or sets the css class to be applied to the container element of the current pager item. 282 | 283 | 284 | 285 | --- 286 | ##### NavigationPagerItemContainerTagName 287 | 288 | Gets or sets the tag name of the container element that wraps first,last,next and previous pager items, default value is null. 289 | 290 | 291 | 292 | --- 293 | ##### NavigationPagerItemContainerCssClass 294 | 295 | Gets or sets the css class to be applied to the container element of first,last,next and previous pager items. 296 | 297 | 298 | 299 | --- 300 | ##### MorePagerItemContainerTagName 301 | 302 | Gets or sets the tag name of the container element that wraps more pager items, default value is null. 303 | 304 | 305 | 306 | --- 307 | ##### MorePagerItemContainerCssClass 308 | 309 | Gets or sets the css class to be applied to the container element of more pager items. 310 | 311 | 312 | 313 | --- 314 | ##### DisabledPagerItemContainerTagName 315 | 316 | Gets or sets the tag name of the container element that wraps disabled pager items, default value is null. 317 | 318 | 319 | 320 | > When the current page index is 1, the first and the previous navigation pager items will be disabled; When the current page index is the last page index, then the next and the last navigation pager items will be disabled; 321 | 322 | 323 | 324 | --- 325 | ##### DisabledPagerItemContainerCssClass 326 | 327 | Gets or sets the css class to be applied to the container element of the disabled pager item. 328 | 329 | 330 | 331 | --- 332 | ##### RenderAfterBeginTag 333 | 334 | Gets or sets the delegate that render the content after the begin tag of the pager component. 335 | 336 | 337 | 338 | --- 339 | ##### RenderBeforeEndTag 340 | 341 | Gets or sets the delegate that render the content before the end tag of the pager component. 342 | 343 | 344 | 345 | --- 346 | ##### CurrentPageIndex 347 | 348 | Gets the current page index. 349 | 350 | 351 | 352 | --- 353 | ##### TotalPageCount 354 | 355 | Gets the total number of pages that are available for paging. 356 | 357 | 358 | 359 | --- 360 | 361 | ## Methods: ## 362 | 363 | --- 364 | ##### GoToPage(System.Int32) 365 | 366 | Go to the specified page index. 367 | 368 | |Name | Description | 369 | |-----|------| 370 | |pageIndex: |1-based number of the page to go to.| 371 | 372 | 373 | --- 374 | -------------------------------------------------------------------------------- /Demo/RazorComponents/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/BlazorHosted/BlazorHosted.Client/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'} -------------------------------------------------------------------------------- /BlazorPager/Properties.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using Microsoft.AspNetCore.Components.Services; 3 | using System; 4 | 5 | namespace Webdiyer.AspNetCore 6 | { 7 | public partial class BlazorPager 8 | { 9 | [Inject] 10 | private IUriHelper UriHelper { get; set; } 11 | 12 | /// 13 | [Parameter] 14 | private string TagName { get; set; } = "div"; 15 | 16 | /// 17 | [Parameter] 18 | public int PageSize { get; private set; } = 10; 19 | 20 | /// 21 | [Parameter] 22 | private int InitPageIndex { get; set; } = 1; 23 | 24 | /// 25 | [Parameter] 26 | private int TotalItemCount { get; set; } 27 | 28 | /// 29 | [Parameter] 30 | private string NumericPagerItemTextFormatString { get; set; } 31 | 32 | /// 33 | [Parameter] 34 | private string CurrentPagerItemTextFormatString { get; set; } 35 | 36 | /// 37 | [Parameter] 38 | private string RoutePattern { get; set; } = "{0}"; 39 | 40 | /// 41 | [Parameter] 42 | private int NumericPagerItemCount { get; set; } = 10; 43 | 44 | /// 45 | [Parameter] 46 | private Action OnPageChanged { get; set; } 47 | 48 | /// 49 | [Parameter] 50 | private string PagerItemCssClass { get; set; } 51 | 52 | /// 53 | [Parameter] 54 | private string MorePagerItemCssClass { get; set; } 55 | 56 | /// 57 | [Parameter] 58 | private string NumericPagerItemCssClass { get; set; } 59 | 60 | /// 61 | [Parameter] 62 | private string NavigationPagerItemCssClass { get; set; } 63 | 64 | /// 65 | [Parameter] 66 | private string CurrentPagerItemCssClass { get; set; } 67 | 68 | /// 69 | [Parameter] 70 | private string DisabledPagerItemCssClass { get; set; } 71 | 72 | /// 73 | [Parameter] 74 | private bool AutoHide { get; set; } = true; 75 | 76 | /// 77 | [Parameter] 78 | private bool ShowNumericPagerItems { get; set; } = true; 79 | 80 | /// 81 | [Parameter] 82 | private bool ShowMorePagerItems { get; set; } = true; 83 | 84 | /// 85 | [Parameter] 86 | private bool ShowFirstLast { get; set; } = true; 87 | 88 | /// 89 | [Parameter] 90 | private bool ShowPrevNext { get; set; } = true; 91 | 92 | /// 93 | [Parameter] 94 | private string FirstPageText { get; set; } = "<<"; 95 | 96 | /// 97 | [Parameter] 98 | private string PrevPageText { get; set; } = "<"; 99 | 100 | /// 101 | [Parameter] 102 | private string NextPageText { get; set; } = ">"; 103 | 104 | /// 105 | [Parameter] 106 | private string LastPageText { get; set; } = ">>"; 107 | 108 | /// 109 | [Parameter] 110 | private string MorePageText { get; set; } = "..."; 111 | 112 | /// 113 | [Parameter] 114 | private string PagerItemContainerTagName { get; set; } 115 | 116 | /// 117 | [Parameter] 118 | private string PagerItemContainerCssClass { get; set; } 119 | 120 | /// 121 | [Parameter] 122 | private string NumericPagerItemContainerTagName { get; set; } 123 | 124 | /// 125 | [Parameter] 126 | private string NumericPagerItemContainerCssClass { get; set; } 127 | 128 | /// 129 | [Parameter] 130 | private string CurrentPagerItemContainerTagName { get; set; } 131 | 132 | /// 133 | [Parameter] 134 | private string CurrentPagerItemContainerCssClass { get; set; } 135 | 136 | /// 137 | [Parameter] 138 | private string NavigationPagerItemContainerTagName { get; set; } 139 | 140 | /// 141 | [Parameter] 142 | private string NavigationPagerItemContainerCssClass { get; set; } 143 | 144 | /// 145 | [Parameter] 146 | private string MorePagerItemContainerTagName { get; set; } 147 | 148 | /// 149 | [Parameter] 150 | private string MorePagerItemContainerCssClass { get; set; } 151 | 152 | /// 153 | [Parameter] 154 | private string DisabledPagerItemContainerTagName { get; set; } 155 | 156 | /// 157 | [Parameter] 158 | private string DisabledPagerItemContainerCssClass { get; set; } 159 | 160 | /// 161 | [Parameter] 162 | private RenderFragment RenderAfterBeginTag { get; set; } 163 | 164 | /// 165 | [Parameter] 166 | private RenderFragment RenderBeforeEndTag { get; set; } 167 | 168 | /// 169 | public int CurrentPageIndex { get; private set; } = 1; 170 | 171 | /// 172 | public int TotalPageCount { get; private set; } 173 | 174 | private int startPageIndex { get; set; } 175 | 176 | private int endPageIndex { get; set; } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /BlazorPager/docs/BlazorPagerDoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Pagination component for Blazor and Razor Components application. 5 | 6 | 7 | 8 | 9 | Gets or sets the HTML tag name for the container element of the pager, default value is div. 10 | 11 | 12 | 13 | Gets the current page index. 14 | 15 | 16 | 17 | Gets or sets the current page index value when the pager component initialized first time. 18 | 19 | 20 | 21 | Gets or sets the number of data items that are displayed for each page of data. 22 | 23 | 24 | Gets or sets the total number of data items that are available for paging. 25 | 26 | 27 | Gets the total number of pages that are available for paging. 28 | 29 | 30 | 31 | Gets or sets the maximum number of the numeric pager items to be displayed. 32 | 33 | 34 | 35 | 36 | Gets or sets a value indicating whether the previous page and the next page pager items should be displayed. 37 | 38 | 39 | 40 | 41 | Gets or sets a value indicating whether the first page and the last page pager items should be displayed. 42 | 43 | 44 | 45 | 46 | Gets or sets a value indicating whether the numeric pager items should be displayed. 47 | 48 | 49 | 50 | 51 | Gets or sets a value indicating whether the more pager items should be displayed. 52 | 53 | 54 | 55 | 56 | Gets or sets the text displayed for the previous page pager item. 57 | 58 | 59 | 60 | 61 | Gets or sets the text displayed for the next page pager item. 62 | 63 | 64 | 65 | 66 | Gets or sets the text displayed for the first page button. 67 | 68 | 69 | 70 | 71 | Gets or sets the text displayed for the last page pager item. 72 | 73 | 74 | 75 | 76 | Gets or sets the text displayed for the more pager items. 77 | 78 | 79 | 80 | 81 | Gets or sets a value indicating whether MvcPager should be hidden if there's only one page of data. 82 | 83 | 84 | 85 | 86 | Gets or sets the css class to be applied to every pager items. 87 | 88 | 89 | 90 | 91 | Gets or sets the css class to be applied to the current page pager item. 92 | 93 | 94 | 95 | 96 | Gets or sets the css class to be applied to the numeric pager items. 97 | 98 | 99 | 100 | 101 | Gets or sets the css class to be applied to the disabled navigation pager items. 102 | 103 | 104 | 105 | 106 | Gets or sets the css class to be applied to the first, previous, next and last page pager items. 107 | 108 | 109 | 110 | 111 | Gets or sets the css class to be applied to the more pager items. 112 | 113 | 114 | 115 | 116 | Gets or sets the format string for all numeric pager items. 117 | 118 | 119 | 120 | 121 | Gets or sets the format string for the current page number. 122 | 123 | 124 | 125 | 126 | Gets or sets the route template that the pager component used to generate pagination links, it must contains a placeholder "{0}" for page index. 127 | 128 | 129 | 130 | 131 | Gets or sets an action that been invoked when page index changed. 132 | 133 | 134 | 135 | 136 | Gets or sets the tag name of the container element that wraps every pager items, default value is null. 137 | 138 | 139 | 140 | 141 | Gets or sets the css class to be applied to the container element of pager items. 142 | 143 | 144 | 145 | 146 | Gets or sets the tag name of the container element that wraps every numeric pager items, default value is null. 147 | 148 | 149 | 150 | 151 | Gets or sets the css class to be applied to the container element of numeric pager items. 152 | 153 | 154 | 155 | 156 | Gets or sets the tag name of the container element that wraps current pager item, default value is null. 157 | 158 | 159 | 160 | 161 | Gets or sets the css class to be applied to the container element of the current pager item. 162 | 163 | 164 | 165 | 166 | Gets or sets the tag name of the container element that wraps first,last,next and previous pager items, default value is null. 167 | 168 | 169 | 170 | 171 | Gets or sets the css class to be applied to the container element of first,last,next and previous pager items. 172 | 173 | 174 | 175 | 176 | Gets or sets the tag name of the container element that wraps more pager items, default value is null. 177 | 178 | 179 | 180 | 181 | Gets or sets the css class to be applied to the container element of more pager items. 182 | 183 | 184 | 185 | 186 | Gets or sets the tag name of the container element that wraps disabled pager items, default value is null. 187 | 188 | 189 | When the current page index is 1, the first and the previous navigation pager items will be disabled; When the current page index is the last page index, then the next and the last navigation pager items will be disabled; 190 | 191 | 192 | 193 | 194 | Gets or sets the css class to be applied to the container element of the disabled pager item. 195 | 196 | 197 | 198 | 199 | Gets or sets the delegate that render the content after the begin tag of the pager component. 200 | 201 | 202 | 203 | 204 | Gets or sets the delegate that render the content before the end tag of the pager component. 205 | 206 | 207 | 208 | 209 | Go to the specified page index. 210 | 211 | 1-based number of the page to go to. 212 | 213 | 214 | 215 | Override the ComponentBase.OnInit method. 216 | 217 | 218 | 219 | 220 | Override the ComponentBase.OnParametersSet method. 221 | 222 | 223 | 224 | 225 | Override the ComponentBase.BuildRenderTree method. 226 | 227 | A RenderTreeBuilder that will receive the render output. 228 | 229 | 230 | 231 | Override the ComponentBase.SetParametersAsync method. 232 | 233 | The parameters to apply. 234 | 235 | -------------------------------------------------------------------------------- /BlazorPager/BlazorPager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Components; 7 | using Microsoft.AspNetCore.Components.RenderTree; 8 | 9 | namespace Webdiyer.AspNetCore 10 | { 11 | /// 12 | public partial class BlazorPager : ComponentBase 13 | { 14 | private void ChangePage(int pageIndex) 15 | { 16 | if (pageIndex > 0&&pageIndex!=CurrentPageIndex) 17 | { 18 | CurrentPageIndex = pageIndex; 19 | OnPageChanged?.Invoke(pageIndex); 20 | StateHasChanged(); 21 | } 22 | } 23 | 24 | IDictionary customAttributes=new Dictionary(); 25 | 26 | /// 27 | public override Task SetParametersAsync(ParameterCollection parameters) 28 | { 29 | var props = this.GetType().GetProperties(BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.Public).Where(p => p.GetCustomAttributes(false).Any(a => a is ParameterAttribute)).Select(p=>p.Name).ToArray(); 30 | var allPrms=(IDictionary)parameters.ToDictionary(); 31 | var validPrms = new Dictionary(); 32 | //remove custom attributes from parameter collection and add to customAttributes variable for rendering in BuildRenderTree method 33 | 34 | foreach (var prm in allPrms) 35 | { 36 | if (props.Contains(prm.Key)) 37 | { 38 | validPrms.Add(prm.Key, prm.Value); 39 | } 40 | else 41 | { 42 | if (!customAttributes.ContainsKey(prm.Key)) 43 | { 44 | customAttributes.Add(prm); 45 | } 46 | } 47 | } 48 | return base.SetParametersAsync(ParameterCollection.FromDictionary(validPrms)); 49 | } 50 | 51 | 52 | /// 53 | protected override void OnInit() 54 | { 55 | if (InitPageIndex > 1) 56 | { 57 | CurrentPageIndex = InitPageIndex; 58 | } 59 | } 60 | 61 | /// 62 | protected override void OnParametersSet() 63 | { 64 | TotalPageCount = (int)Math.Ceiling(TotalItemCount / (double)PageSize); 65 | var _startPageIndex = CurrentPageIndex - (NumericPagerItemCount / 2); 66 | if (_startPageIndex + NumericPagerItemCount > TotalPageCount) 67 | _startPageIndex = TotalPageCount + 1 - NumericPagerItemCount; 68 | if (_startPageIndex < 1) 69 | _startPageIndex = 1; 70 | startPageIndex = _startPageIndex; 71 | var _endPageIndex = _startPageIndex + NumericPagerItemCount - 1; 72 | if (_endPageIndex > TotalPageCount) 73 | _endPageIndex = TotalPageCount; 74 | endPageIndex = _endPageIndex; 75 | base.OnParametersSet(); 76 | } 77 | 78 | 79 | /// 80 | protected override void BuildRenderTree(RenderTreeBuilder builder) 81 | { 82 | base.BuildRenderTree(builder); 83 | if (!AutoHide || TotalItemCount > PageSize) 84 | { 85 | var seq = 0; 86 | builder.OpenElement(seq, TagName); 87 | if (customAttributes != null) 88 | { 89 | foreach(var attr in customAttributes) 90 | { 91 | builder.AddAttribute(++seq, attr.Key, attr.Value); 92 | } 93 | } 94 | RenderAfterBeginTag?.Invoke(builder); 95 | //first page 96 | if (ShowFirstLast) 97 | { 98 | createPagerItem(builder, ref seq, CurrentPageIndex > 1?1:0,FirstPageText, CurrentPageIndex == 1?PagerItemType.Disabled: PagerItemType.Navigation); 99 | } 100 | //prev page 101 | if (ShowPrevNext) 102 | { 103 | createPagerItem(builder,ref seq, CurrentPageIndex - 1,PrevPageText, CurrentPageIndex == 1 ? PagerItemType.Disabled : PagerItemType.Navigation); 104 | } 105 | //more page 106 | if (ShowMorePagerItems && startPageIndex>1) 107 | { 108 | createPagerItem(builder, ref seq, startPageIndex-1, MorePageText, PagerItemType.More); 109 | } 110 | if (ShowNumericPagerItems) 111 | { 112 | for (int i = startPageIndex; i <= endPageIndex; i++) 113 | { 114 | var pageNum = i; 115 | createPagerItem(builder,ref seq, pageNum,pageNum.ToString(), CurrentPageIndex == pageNum?PagerItemType.Current:PagerItemType.Number); 116 | } 117 | } 118 | //more page 119 | if (ShowMorePagerItems && endPageIndex < TotalPageCount) 120 | { 121 | createPagerItem(builder, ref seq, endPageIndex + 1, MorePageText, PagerItemType.More); 122 | } 123 | //next page 124 | if (ShowPrevNext) 125 | { 126 | createPagerItem(builder, ref seq, CurrentPageIndex < TotalPageCount? CurrentPageIndex + 1:0,NextPageText, CurrentPageIndex < TotalPageCount? PagerItemType.Navigation:PagerItemType.Disabled); 127 | } 128 | //last page 129 | if (ShowFirstLast) 130 | { 131 | createPagerItem(builder, ref seq, CurrentPageIndex < TotalPageCount ? TotalPageCount : 0,LastPageText, CurrentPageIndex < TotalPageCount ? PagerItemType.Navigation: PagerItemType.Disabled ); 132 | } 133 | RenderBeforeEndTag?.Invoke(builder); 134 | builder.CloseElement(); 135 | } 136 | } 137 | 138 | /// 139 | public void GoToPage(int pageIndex) 140 | { 141 | if (pageIndex > 0) 142 | { 143 | UriHelper.NavigateTo(string.Format(RoutePattern, pageIndex)); 144 | ChangePage(pageIndex); 145 | } 146 | } 147 | 148 | private void createPagerItem(RenderTreeBuilder builder, ref int seq, int pageIndex, string text, PagerItemType itemType) 149 | { 150 | var containerTag = PagerItemContainerTagName; 151 | var containerClass = PagerItemContainerCssClass; 152 | var itemClass = PagerItemCssClass; 153 | switch (itemType) 154 | { 155 | case PagerItemType.Number: 156 | containerTag = GetFirstNonNullString(new[] { NumericPagerItemContainerTagName, containerTag }); 157 | containerClass = GetFirstNonNullString(new[] { NumericPagerItemContainerCssClass, containerClass }); 158 | itemClass = GetFirstNonNullString(new[] { NumericPagerItemCssClass, itemClass }); 159 | break; 160 | case PagerItemType.Navigation: 161 | containerTag = GetFirstNonNullString(new[] { NavigationPagerItemContainerTagName, containerTag }); 162 | containerClass = GetFirstNonNullString(new[] { NavigationPagerItemContainerCssClass, containerClass }); 163 | itemClass = GetFirstNonNullString(new[] { NavigationPagerItemCssClass,itemClass }); 164 | break; 165 | case PagerItemType.Current: 166 | containerTag = GetFirstNonNullString(new[] { CurrentPagerItemContainerTagName, NumericPagerItemContainerTagName, containerTag }); 167 | containerClass = GetFirstNonNullString(new[] { CurrentPagerItemContainerCssClass, NumericPagerItemContainerCssClass, containerClass }); 168 | itemClass = GetFirstNonNullString(new[] { CurrentPagerItemCssClass, NumericPagerItemCssClass, itemClass }); 169 | break; 170 | case PagerItemType.More: 171 | containerTag = GetFirstNonNullString(new[] { MorePagerItemContainerTagName, containerTag }); 172 | containerClass = GetFirstNonNullString(new[] { MorePagerItemContainerCssClass, containerClass }); 173 | itemClass = GetFirstNonNullString(new[] { MorePagerItemCssClass, itemClass }); 174 | break; 175 | case PagerItemType.Disabled: 176 | containerTag = GetFirstNonNullString(new[] { DisabledPagerItemContainerTagName,NavigationPagerItemContainerTagName, containerTag }); 177 | containerClass = GetFirstNonNullString(new[] { DisabledPagerItemContainerCssClass,NavigationPagerItemContainerCssClass, containerClass }); 178 | itemClass = GetFirstNonNullString(new[] { DisabledPagerItemCssClass, NavigationPagerItemCssClass, itemClass }); 179 | break; 180 | } 181 | bool hasContainerTag = !string.IsNullOrWhiteSpace(containerTag); 182 | if (hasContainerTag) 183 | { 184 | builder.OpenElement(++seq, containerTag); 185 | if (!string.IsNullOrWhiteSpace(containerClass)) 186 | { 187 | builder.AddAttribute(++seq, "class", containerClass); 188 | } 189 | } 190 | builder.OpenElement(++seq, "a"); 191 | if (!string.IsNullOrWhiteSpace(itemClass)) 192 | { 193 | builder.AddAttribute(++seq, "class", itemClass); 194 | } 195 | if (pageIndex > 0) 196 | { 197 | builder.AddAttribute(++seq, "href", string.Format(RoutePattern, pageIndex)); 198 | builder.AddAttribute(++seq, "onclick", BindMethods.GetEventHandlerValue(() => ChangePage(pageIndex))); 199 | } 200 | var pagerItemText = text; 201 | if (itemType == PagerItemType.Number || itemType == PagerItemType.Current) 202 | { 203 | var numberFormat = string.IsNullOrWhiteSpace(NumericPagerItemTextFormatString) ? "{0}" : NumericPagerItemTextFormatString; 204 | if (itemType == PagerItemType.Current && !string.IsNullOrWhiteSpace((CurrentPagerItemTextFormatString))) 205 | { 206 | numberFormat = CurrentPagerItemTextFormatString; 207 | } 208 | pagerItemText = string.Format(numberFormat, text); 209 | } 210 | builder.AddMarkupContent(++seq,pagerItemText); 211 | builder.CloseElement(); 212 | if (hasContainerTag) 213 | { 214 | builder.CloseElement(); 215 | } 216 | } 217 | 218 | private string GetFirstNonNullString(string[] values) 219 | { 220 | for(var i = 0; i < values.Length; i++) 221 | { 222 | if (values[i]!=null) 223 | return values[i]; 224 | } 225 | return string.Empty; 226 | } 227 | } 228 | } --------------------------------------------------------------------------------