mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-03 21:29:20 +00:00
Serve demo source from wwwroot instead of github.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -347,3 +347,4 @@ Radzen.Blazor.min.js
|
||||
*.md
|
||||
/.gitignore
|
||||
/.gitignore
|
||||
RadzenBlazorDemos/wwwroot/demos
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
<RadzenText TextStyle="TextStyle.H2" TagName="TagName.H1" class="rz-pt-8">
|
||||
Blazor GitHub Issues
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Dashboard" Example="Dashboard" AdditionalSourceCodePages="@(["../Services/GitHubService.cs"] )">
|
||||
<RadzenExample ComponentName="Dashboard" Example="Dashboard" AdditionalSourceCodePages="@(["/demos/Services/GitHubService.cs"] )">
|
||||
<Dashboard />
|
||||
</RadzenExample>
|
||||
@@ -12,6 +12,6 @@
|
||||
data formatting and HTML embedding.
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridColumnTemplate" AdditionalSourceCodePages=@(new List<string>() { "DialogCardPage.razor" })>
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridColumnTemplate" AdditionalSourceCodePages=@(new List<string>() { "/demos/Pages/DialogCardPage.razor" })>
|
||||
<DataGridColumnTemplate/>
|
||||
</RadzenExample>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
Set the initial filter of your RadzenDataGrid via the <code>FilterValue</code> and <code>FilterOperator</code> column properties.
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridFilterApi" AdditionalSourceCodePages=@(new [] { "MyCustomDataGridColumn.razor" })>
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridFilterApi" AdditionalSourceCodePages=@(new [] { "/demos/Pages/MyCustomDataGridColumn.razor" })>
|
||||
<DataGridFilterApi />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
The <strong>FooterTemplate</strong> column property allows you to display aggregated data in the column footer.
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridFooterTotals" AdditionalSourceCodePages="@(new [] {"../Shared/RenderOnceComponent.razor"})">
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridFooterTotals" AdditionalSourceCodePages="@(new [] {"/demos/Shared/RenderOnceComponent.razor"})">
|
||||
<DataGridFooterTotals />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
Use the <code>LoadData</code> event to get data from a REST service.
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridOData" Heading="false" AdditionalSourceCodePages="@(new [] {"../Services/NorthwindODataService.cs"})" Documentation="false">
|
||||
<RadzenExample ComponentName="DataGrid" Example="DataGridOData" Heading="false" AdditionalSourceCodePages="@(new [] {"/demos/Services/NorthwindODataService.cs"})" Documentation="false">
|
||||
<DataGridOData />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<RadzenText Anchor="dialog#open-page-as-dialog" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-8 rz-mb-6">
|
||||
Open page as a dialog
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Dialog" Example="DialogWithPage" AdditionalSourceCodePages=@(new List<string>() { "DialogCardPage.razor" })>
|
||||
<RadzenExample ComponentName="Dialog" Example="DialogWithPage" AdditionalSourceCodePages=@(new List<string>() { "/demos/Pages/DialogCardPage.razor" })>
|
||||
<DialogWithPage />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -75,6 +75,6 @@
|
||||
to update dialog properties
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="Dialog" Example="DialogWithCascadingValueCaller" AdditionalSourceCodePages=@(new List<string>() { "DialogWithCascadingValueImplementation.razor" })>
|
||||
<RadzenExample ComponentName="Dialog" Example="DialogWithCascadingValueCaller" AdditionalSourceCodePages=@(new List<string>() { "/demos/Pages/DialogWithCascadingValueImplementation.razor" })>
|
||||
<DialogWithCascadingValueCaller />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
This page demonstrates how to export a Radzen Blazor DataGrid to Excel and CSV.
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="DataGrid" Example="ExportToExcelCsv" AdditionalSourceCodePages="@(new [] {"../Services/NorthwindService.cs", "../../RadzenBlazorDemos.Host/Controllers/ExportNorthwindController.cs", "../../RadzenBlazorDemos.Host/Controllers/ExportController.cs"})">
|
||||
<RadzenExample ComponentName="DataGrid" Example="ExportToExcelCsv" AdditionalSourceCodePages="@(new [] {"/demos/Services/NorthwindService.cs", "/demos/Controllers/ExportNorthwindController.cs", "/demos/Controllers/ExportController.cs"})">
|
||||
<ExportToExcelCsv />
|
||||
</RadzenExample>
|
||||
@@ -30,6 +30,6 @@
|
||||
<RadzenText Anchor="html-editor-custom-tools#command-dialog" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12 rz-mb-6">
|
||||
Custom dialog
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="HtmlEditor" Example="HtmlEditorCustomToolDialog" AdditionalSourceCodePages=@(new [] {"HtmlEditorCustomDialog.razor"})>
|
||||
<RadzenExample ComponentName="HtmlEditor" Example="HtmlEditorCustomToolDialog" AdditionalSourceCodePages=@(new [] {"/demos/Pages/HtmlEditorCustomDialog.razor"})>
|
||||
<HtmlEditorCustomToolDialog />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -76,7 +76,7 @@ The Radzen HtmlEditor supports the following tools:
|
||||
<code><RadzenHtmlEditor @@bind-Value=@@htmlValue UploadUrl="upload/image" /></code>.
|
||||
For a sample implementation check the <code>UploadController.cs</code> tab.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="HtmlEditor" Example="HtmlEditorUploadUrl" AdditionalSourceCodePages="@(new [] { "../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"})" >
|
||||
<RadzenExample ComponentName="HtmlEditor" Example="HtmlEditorUploadUrl" AdditionalSourceCodePages="@(new [] { "/demos/Controllers/UploadController.cs"})" >
|
||||
<HtmlEditorUploadUrl />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="html-editor#focus" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12 rz-mb-6">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<RadzenText Anchor="scheduler#views" TextStyle="TextStyle.H5" TagName="TagName.H2">
|
||||
Day, week and month views
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerConfig" AdditionalSourceCodePages=@(new [] { "../Models/Appointment.cs", "AddAppointmentPage.razor", "EditAppointmentPage.razor" })>
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerConfig" AdditionalSourceCodePages=@(new [] { "/demos/Models/Appointment.cs", "AddAppointmentPage.razor", "EditAppointmentPage.razor" })>
|
||||
<SchedulerConfig />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
Plan out the whole year with <code><RadzenYearPlannerView /></code> and <code><RadzenYearTimelineView /></code>.
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerPlannerTimeline" AdditionalSourceCodePages=@(new [] { "../Models/Appointment.cs", "AddAppointmentPage.razor", "EditAppointmentPage.razor" })>
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerPlannerTimeline" AdditionalSourceCodePages=@(new [] { "/demos/Models/Appointment.cs", "AddAppointmentPage.razor", "EditAppointmentPage.razor" })>
|
||||
<SchedulerPlannerTimeline />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
Display additional content when the user hovers an appointment
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerTooltips" AdditionalSourceCodePages=@(new [] { "../Models/Appointment.cs" })>
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerTooltips" AdditionalSourceCodePages=@(new [] { "/demos/Models/Appointment.cs" })>
|
||||
<SchedulerTooltips />
|
||||
</RadzenExample>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
Display any number of days side-by-side
|
||||
</RadzenText>
|
||||
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerMultiDay" AdditionalSourceCodePages=@(new [] { "../Models/Appointment.cs" })>
|
||||
<RadzenExample ComponentName="Scheduler" Example="SchedulerMultiDay" AdditionalSourceCodePages=@(new [] { "/demos/Models/Appointment.cs" })>
|
||||
<SchedulerMultiDay />
|
||||
</RadzenExample>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
To upload files to a server set the <code>Url</code> property of the component. The URL should point to an action method in your server-side code that handles the file upload.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadUrl)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadUrl)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadUrl />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#multiple" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -32,7 +32,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
To upload multiple files set the <code>Multiple</code> property of the component to <code>true</code>.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadMultiple)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadMultiple)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadMultiple />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#from-code" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -41,7 +41,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
To trigger the upload from code set the <code>Auto</code> property of the component to <code>false</code>. The upload can be triggered by calling the <code>Upload()</code> method of the component.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadFromCode)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadFromCode)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadFromCode />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#filter" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -50,7 +50,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
To filter the files that can be uploaded use the <code>Accept</code> property of the component. The Value should be a comma separated list <RadzenLink Path="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers">unique file type specifiers</RadzenLink>
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadImage)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadImage)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadImage />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#parameters" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -59,7 +59,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
To send additional parameters with the upload request use the <code>Url</code> property of the component.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadParameters)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadParameters)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadParameters />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#progress" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -68,7 +68,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
This demo shows how to use the <code>RadzenProgressBar</code> component to show upload progress by handling the <code>Progress</code> event.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadProgress)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadProgress)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadProgress />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#drag-drop" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -77,7 +77,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
This demo shows how to use the <code>RadzenUpload</code> component to allow users to drag and drop files for upload. The <code>ChooseText</code> property is used to set the text displayed when no files are selected.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadDragDrop)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadDragDrop)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadDragDrop />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#custom-headers" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -86,7 +86,7 @@
|
||||
<RadzenText TextStyle="TextStyle.Body1" class="rz-mb-8">
|
||||
To send custom HTTP headers with the upload request use <code>RadzenUploadHeader</code>.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadCustomHeaders)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadCustomHeaders)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadCustomHeaders />
|
||||
</RadzenExample>
|
||||
<RadzenText Anchor="example-upload#parameter-name" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-12">
|
||||
@@ -96,7 +96,7 @@
|
||||
To specify the action method parameter name use the <code>ParameterName</code> property of the component. The value should be a string. By default the parameter name is <code>file</code>
|
||||
or <code>files</code> if the <code>Multiple</code> property is set to <code>true</code>.
|
||||
</RadzenText>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadParameterName)" AdditionalSourceCodePages=@(["../../RadzenBlazorDemos.Host/Controllers/UploadController.cs"])>
|
||||
<RadzenExample ComponentName="Upload" Example="@nameof(UploadParameterName)" AdditionalSourceCodePages=@(["/demos/Controllers/UploadController.cs"])>
|
||||
<UploadParameterName />
|
||||
</RadzenExample>
|
||||
|
||||
|
||||
@@ -25,4 +25,21 @@
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Target Name="CopyDemoPagesToWwwroot" AfterTargets="Build;Publish">
|
||||
<ItemGroup>
|
||||
<DemoPagesRazor Include="Pages\**\*.razor" />
|
||||
<DemoPagesCs Include="Pages\**\*.cs" />
|
||||
<DemoModelsCs Include="Models\**\*.cs" />
|
||||
<DemoServicesCs Include="Services\**\*.cs" />
|
||||
<DemoSharedRazor Include="Shared\**\*.razor" />
|
||||
<DemoHostControllersCs Include="..\RadzenBlazorDemos.Host\Controllers\**\*.cs" />
|
||||
</ItemGroup>
|
||||
<MakeDir Directories="$(ProjectDir)wwwroot\demos" />
|
||||
<Copy SourceFiles="@(DemoPagesRazor)" DestinationFiles="@(DemoPagesRazor->'$(ProjectDir)wwwroot\demos\Pages\%(RecursiveDir)%(Filename).txt')" SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="@(DemoPagesCs)" DestinationFiles="@(DemoPagesCs->'$(ProjectDir)wwwroot\demos\Pages\%(RecursiveDir)%(Filename).txt')" SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="@(DemoModelsCs)" DestinationFiles="@(DemoModelsCs->'$(ProjectDir)wwwroot\demos\Models\%(RecursiveDir)%(Filename).txt')" SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="@(DemoServicesCs)" DestinationFiles="@(DemoServicesCs->'$(ProjectDir)wwwroot\demos\Services\%(RecursiveDir)%(Filename).txt')" SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="@(DemoSharedRazor)" DestinationFiles="@(DemoSharedRazor->'$(ProjectDir)wwwroot\demos\Shared\%(RecursiveDir)%(Filename).txt')" SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="@(DemoHostControllersCs)" DestinationFiles="@(DemoHostControllersCs->'$(ProjectDir)wwwroot\demos\Controllers\%(RecursiveDir)%(Filename).txt')" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,6 +1,9 @@
|
||||
@using System.Text.RegularExpressions;
|
||||
@using System.IO;
|
||||
@using System.Net.Http;
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject CompilerService Compiler
|
||||
@inject HttpClient Http
|
||||
|
||||
<RadzenRow class="rz-p-2" Gap="0.5rem" Style="border-bottom: var(--rz-border-disabled);">
|
||||
<RadzenColumn>
|
||||
@@ -73,7 +76,7 @@
|
||||
|
||||
string ComponentSourceHref => ComponentSource ?? $"https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/Radzen{ComponentName}.razor.cs";
|
||||
|
||||
string PageSourceHref => $"https://raw.githubusercontent.com/radzenhq/radzen-blazor/master/RadzenBlazorDemos/Pages/{PageName}";
|
||||
string PageSourceHref => Path.ChangeExtension(PageName != null && PageName.StartsWith("/") ? PageName : $"/demos/Pages/{PageName}", ".txt");
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
language = PageName == null ? "razor" : PageName.EndsWith(".razor") ? "razor" : "csharp";
|
||||
@@ -92,9 +95,7 @@
|
||||
|
||||
async Task<string> Fetch()
|
||||
{
|
||||
using var http = new HttpClient();
|
||||
|
||||
return await http.GetStringAsync(PageSourceHref);
|
||||
return await Http.GetStringAsync(PageSourceHref);
|
||||
}
|
||||
|
||||
string Clean(string source)
|
||||
@@ -118,6 +119,8 @@
|
||||
await OnValueChanged(source);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool isBusy;
|
||||
|
||||
async Task Run()
|
||||
|
||||
Reference in New Issue
Block a user