Skip to content

Commit

Permalink
Merge branch 'rel-1.3' into rel-1.3-snackbarError
Browse files Browse the repository at this point in the history
  • Loading branch information
stsrki committed Oct 7, 2023
2 parents 0022cc0 + 06b22c3 commit 9cd20ac
Show file tree
Hide file tree
Showing 42 changed files with 470 additions and 262 deletions.
121 changes: 120 additions & 1 deletion Demos/Blazorise.Demo/Components/TopMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@using Blazorise.Localization
@using System.Collections.Generic
@inject NavigationManager NavigationManager
@implements IDisposable

<Bar @bind-Visible="@topbarVisible" Breakpoint="Breakpoint.Desktop" Background="Background.White" Shadow="Shadow.Default" ThemeContrast="ThemeContrast.Light">
<BarBrand>
Expand Down Expand Up @@ -81,9 +84,16 @@
</BarDropdownMenu>
</BarDropdown>
</BarItem>

</BarStart>
<BarEnd>
@if ( gitHubDemoUrl != null )
{
<BarItem>
<BarLink To="@gitHubDemoUrl" Target="Target.Blank">
Source Code <Icon Name="IconName.ExternalLinkSquareAlt" Margin="Margin.Is2.FromStart" />
</BarLink>
</BarItem>
}
<BarItem>
<BarDropdown RightAligned>
<BarDropdownToggle><Icon Name="IconName.Language" /></BarDropdownToggle>
Expand Down Expand Up @@ -165,6 +175,115 @@
return LayoutTypeChanged.InvokeAsync( layoutType );
}

Dictionary<string, string> demoToGitHubMapping = new Dictionary<string, string>
{
{ "", "Pages/Dashboard.razor" },
{ "tests/alerts", "Pages/Tests/AlertsPage.razor" },
{ "tests/animate", "Pages/Tests/AnimatePage.razor" },
{ "tests/autocomplete", "Pages/Tests/AutocompletesPage.razor" },
{ "tests/badges", "Pages/Tests/BadgesPage.razor" },
{ "tests/utilities/borders", "Pages/Tests/BordersPage.razor" },
{ "tests/breadcrumbs", "Pages/Tests/BreadcrumbsPage.razor" },
{ "tests/buttons", "Pages/Tests/ButtonsPage.razor" },
{ "tests/cards", "Pages/Tests/CardsPage.razor" },
{ "tests/carousel", "Pages/Tests/CarouselPage.razor" },
{ "tests/charts/annotations", "Pages/Tests/ChartsAnnotationsPage.razor" },
{ "tests/charts/datalabels", "Pages/Tests/ChartsDataLabelsPage.razor" },
{ "tests/charts", "Pages/Tests/ChartsPage.razor" },
{ "tests/collapse", "Pages/Tests/CollapsePage.razor" },
{ "tests/cropper", "Pages/Tests/CropperPage.razor" },
{ "tests/dragdrop", "Pages/Tests/DragDropPage.razor" },
{ "tests/dropdownlist", "Pages/Tests/DropdownListPage.razor" },
{ "tests/dropdowns", "Pages/Tests/DropdownsPage.razor" },
{ "tests/figures", "Pages/Tests/FigurePage.razor" },
{ "tests/file-picker", "Pages/Tests/FilePickerPage.razor" },
{ "tests/utilities/flex", "Pages/Tests/FlexPage.razor" },
{ "tests/focus-trap", "Pages/Tests/FocusTrapPage.razor" },
{ "tests/forms", "Pages/Tests/FormsPage.razor" },
{ "tests/utilities/grid", "Pages/Tests/GridPage.razor" },
{ "tests/icons", "Pages/Tests/IconsPage.razor" },
{ "tests/jumbotrons", "Pages/Tests/JumbotronsPage.razor" },
{ "tests/utilities/layout", "Pages/Tests/LayoutPage.razor" },
{ "tests/listgroup", "Pages/Tests/ListGroupPage.razor" },
{ "tests/listview", "Pages/Tests/ListViewPage.razor" },
{ "tests/livecharts", "Pages/Tests/LiveChartsPage.razor" },
{ "tests/loadingindicator", "Pages/Tests/LoadingIndicatorPage.razor" },
{ "tests/lottie-animation", "Pages/Tests/LottieAnimationPage.razor" },
{ "tests/markdown", "Pages/Tests/MarkdownPage.razor" },
{ "tests/misc-forms", "Pages/Tests/MiscFormPage.razor" },
{ "tests/modal-provider", "Pages/Tests/ModalProviderPage.razor" },
{ "tests/modals", "Pages/Tests/ModalsPage.razor" },
{ "tests/offcanvas", "Pages/Tests/OffcanvasPage.razor" },
{ "tests/utilities/overflow", "Pages/Tests/OverflowPage.razor" },
{ "tests/paginations", "Pages/Tests/PaginationsPage.razor" },
{ "tests/pickers", "Pages/Tests/PickersPage.razor" },
{ "tests/utilities/position", "Pages/Tests/PositionsPage.razor" },
{ "tests/progressbars", "Pages/Tests/ProgressBarsPage.razor" },
{ "tests/qrcode", "Pages/Tests/QRCodePage.razor" },
{ "tests/ratings", "Pages/Tests/RatingPage.razor" },
{ "tests/repeater", "Pages/Tests/RepeaterPage.razor" },
{ "tests/richtextedit", "Pages/Tests/RichTextEditPage.razor" },
{ "tests/selectlist", "Pages/Tests/SelectListPage.razor" },
{ "tests/utilities/services", "Pages/Tests/ServicesPage.razor" },
{ "tests/utilities/shadows", "Pages/Tests/ShadowPage.razor" },
{ "tests/signaturepad", "Pages/Tests/SignaturePadPage.razor" },
{ "tests/utilities/sizing", "Pages/Tests/SizingPage.razor" },
{ "tests/snackbar", "Pages/Tests/SnackbarsPage.razor" },
{ "tests/spinkit", "Pages/Tests/SpinKitPage.razor" },
{ "tests/splitter", "Pages/Tests/SplitterPage.razor" },
{ "tests/steps", "Pages/Tests/StepsPage.razor" },
{ "tests/tables", "Pages/Tests/TablesPage.razor" },
{ "tests/tabs", "Pages/Tests/TabsPage.razor" },
{ "tests/theming", "Pages/Tests/ThemingPage.razor" },
{ "tests/tests/tooltips", "Pages/Tests/TooltipsPage.razor" },
{ "tests/treeview", "Pages/Tests/TreeViewPage.razor" },
{ "tests/typography", "Pages/Tests/TypographyPage.razor" },
{ "tests/validations", "Pages/Tests/ValidationsPage.razor" },
{ "tests/vertical-align", "Pages/Tests/VerticalAlignPage.razor" },
{ "tests/video", "Pages/Tests/VideoPage.razor" },
};

private string gitHubDemoUrl;

protected override void OnInitialized()
{
if ( NavigationManager is not null )
{
DetermineCurrentUrl();

NavigationManager.LocationChanged += OnLocationChanged;
}
}

private void OnLocationChanged( object sender, Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs e )
{
DetermineCurrentUrl();

InvokeAsync( StateHasChanged );
}

private void DetermineCurrentUrl()
{
var url = NavigationManager.ToBaseRelativePath( NavigationManager.Uri );

if ( demoToGitHubMapping.TryGetValue( url, out var gh ) )
{
gitHubDemoUrl = $"https://github.com/Megabit/Blazorise/blob/master/Demos/Blazorise.Demo/{gh}";
}
else
{
gitHubDemoUrl = null;
}
}

void IDisposable.Dispose()
{
if ( NavigationManager is not null )
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
}

[Parameter] public EventCallback<bool> ThemeEnabledChanged { get; set; }

[Parameter] public EventCallback<bool> ThemeGradientChanged { get; set; }
Expand Down
19 changes: 17 additions & 2 deletions Documentation/Blazorise.Docs/Components/Commercial/Faq.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@if ( ShowHeader )
{
<Paragraph TextSize="TextSize.Heading1" TextAlignment="TextAlignment.Center" Margin="Margin.Is4.FromBottom">
FAQ
<Paragraph TextSize="TextSize.Heading1" TextAlignment="TextAlignment.Center" Margin="Margin.Is5.FromTop.Is4.FromBottom">
Frequently asked questions
</Paragraph>
}

Expand Down Expand Up @@ -161,5 +161,20 @@
</Paragraph>
}
},

new FaqInfo {
Title = "What is the difference between Blazorise and Blazorise Blocks?",
Body = (__builder) => {
<Paragraph>
Blazorise is a component library for Blazor that provides a range of UI components and utilities to help developers build web applications more easily.
</Paragraph>
<Paragraph>
Blazorise Blocks are a set of predefined UI elements or modules built on top of the Blazorise library. These blocks simplify the web development process by offering ready-to-use sections (like checkout, stats, login forms, etc.) that developers can integrate into their projects without having to design or code them from scratch.
</Paragraph>
<Paragraph>
In essence, while Blazorise provides the foundational components and tools, Blazorise Blocks offer higher-level, more specialized modules that are based on those foundational components for specific use cases.
</Paragraph>
}
},
};
}
Loading

0 comments on commit 9cd20ac

Please sign in to comment.