diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index ae6152391c67..99c8c75b39b2 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,8 +1,8 @@
# These are supported funding model platforms
+open_collective: mudblazor
github: mudblazor
patreon: # Replace with a single Patreon username
-open_collective: mudblazor
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
diff --git a/.github/workflows/deploy-trymudblazor.yml b/.github/workflows/deploy-trymudblazor.yml
index d20aa7995fac..2814d314d6ad 100644
--- a/.github/workflows/deploy-trymudblazor.yml
+++ b/.github/workflows/deploy-trymudblazor.yml
@@ -28,6 +28,7 @@ jobs:
web-app-slot-name: 'staging'
swap-slots: true
project-directory: './src/TryMudBlazor.Server'
+ second-project-directory: './src/TryMudBlazor.Client'
secrets:
publish-profile: ${{ secrets.PUBLISH_TRY_MUDBLAZOR }}
azure-cred: ${{ secrets.AZURE_CREDENTIALS_TRY_PROD }}
diff --git a/src/MudBlazor.Docs/Components/LandingPage/MiniApp/MiniApp.razor b/src/MudBlazor.Docs/Components/LandingPage/MiniApp/MiniApp.razor
index c69a79dd5262..11f2c272fe8e 100644
--- a/src/MudBlazor.Docs/Components/LandingPage/MiniApp/MiniApp.razor
+++ b/src/MudBlazor.Docs/Components/LandingPage/MiniApp/MiniApp.razor
@@ -150,7 +150,7 @@
RBMK-1000RBMK-1500RBMKP-2400
- Read More
+ Read more
@if(IsMobile == false)
diff --git a/src/MudBlazor.Docs/Components/MudTeamCard.razor b/src/MudBlazor.Docs/Components/MudTeamCard.razor
index cb6afe179b3b..6af2f3c928e0 100644
--- a/src/MudBlazor.Docs/Components/MudTeamCard.razor
+++ b/src/MudBlazor.Docs/Components/MudTeamCard.razor
@@ -14,8 +14,14 @@
}
+ @if(Member.GitHubSponsor)
+ {
+
+
+
+ }
-
+
diff --git a/src/MudBlazor.Docs/Components/SectionContent.razor.cs b/src/MudBlazor.Docs/Components/SectionContent.razor.cs
index 07861486e024..4e31a65baa81 100644
--- a/src/MudBlazor.Docs/Components/SectionContent.razor.cs
+++ b/src/MudBlazor.Docs/Components/SectionContent.razor.cs
@@ -20,6 +20,7 @@ public partial class SectionContent
{
[Inject] protected IJsApiService JsApiService { get; set; }
[Inject] protected IDocsJsApiService DocsJsApiService { get; set; }
+ [Inject] protected ISnackbar SnackbarService { get; set; }
protected string Classname =>
new CssBuilder("docs-section-content")
@@ -108,6 +109,7 @@ private async Task CopyTextToClipboard()
var code = Snippets.GetCode(Code);
code ??= await DocsJsApiService.GetInnerTextByIdAsync(_snippetId);
await JsApiService.CopyToClipboardAsync(code ?? $"Snippet '{Code}' not found!");
+ SnackbarService.Add("Copied to clipboard");
}
RenderFragment CodeComponent(string code) => builder =>
diff --git a/src/MudBlazor.Docs/Enums/DarkLightMode.cs b/src/MudBlazor.Docs/Enums/DarkLightMode.cs
index 7cc9944df7a6..5fe72ab3ea01 100644
--- a/src/MudBlazor.Docs/Enums/DarkLightMode.cs
+++ b/src/MudBlazor.Docs/Enums/DarkLightMode.cs
@@ -1,8 +1,22 @@
namespace MudBlazor.Docs.Enums;
+///
+/// Represents the theme preference for dark or light mode.
+///
public enum DarkLightMode
{
+ ///
+ /// The theme is determined by the operating system or browser.
+ ///
System = 0,
+
+ ///
+ /// Light theme is used.
+ ///
Light = 1,
+
+ ///
+ /// Dark theme is used.
+ ///
Dark = 2
}
diff --git a/src/MudBlazor.Docs/Models/TeamMember.cs b/src/MudBlazor.Docs/Models/TeamMember.cs
index fe782e78458b..303692b855d3 100644
--- a/src/MudBlazor.Docs/Models/TeamMember.cs
+++ b/src/MudBlazor.Docs/Models/TeamMember.cs
@@ -9,6 +9,7 @@ public class TeamMember
public string Name { get; set; }
public string From { get; set; }
public string GitHub { get; set; }
+ public bool GitHubSponsor { get; set; }
public string Avatar { get; set; }
public string LinkedIn { get; set; }
}
diff --git a/src/MudBlazor.Docs/Pages/Components/Alert/Examples/AlertCloseExample.razor b/src/MudBlazor.Docs/Pages/Components/Alert/Examples/AlertCloseExample.razor
index 71f03087ca81..9093c6cdea69 100644
--- a/src/MudBlazor.Docs/Pages/Components/Alert/Examples/AlertCloseExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Alert/Examples/AlertCloseExample.razor
@@ -11,7 +11,7 @@
@if (!showLeaveAlert && !showCallAlert)
{
- Show Alerts
+ Show alerts
}
@@ -36,4 +36,4 @@
showCallAlert = true;
showLeaveAlert = true;
}
-}
\ No newline at end of file
+}
diff --git a/src/MudBlazor.Docs/Pages/Components/Autocomplete/AutocompletePage.razor b/src/MudBlazor.Docs/Pages/Components/Autocomplete/AutocompletePage.razor
index dbdd11ad007b..973c65e53645 100644
--- a/src/MudBlazor.Docs/Pages/Components/Autocomplete/AutocompletePage.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Autocomplete/AutocompletePage.razor
@@ -5,10 +5,6 @@
It is great for searching a value from a long list of options. In comparison to a Select, the Autocomplete doesn't need to know the complete item list,
it only calls a search function which will return matching items. The search function can even run asynchronously, i.e. for database queries.
-
- Note: Blazor static rendering is not supported.
- See install guide for more info.
-
diff --git a/src/MudBlazor.Docs/Pages/Components/Autocomplete/Examples/AutocompletePresentationExtrasExample.razor b/src/MudBlazor.Docs/Pages/Components/Autocomplete/Examples/AutocompletePresentationExtrasExample.razor
index bf758fde6fce..e7a133d99d43 100644
--- a/src/MudBlazor.Docs/Pages/Components/Autocomplete/Examples/AutocompletePresentationExtrasExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Autocomplete/Examples/AutocompletePresentationExtrasExample.razor
@@ -38,7 +38,7 @@
SearchFunc="@Search" ToStringFunc="@(e=> e==null?null : $"{e.Name} ({e.Sign})")">
diff --git a/src/MudBlazor.Docs/Pages/Components/Button/Examples/ButtonCustomizedExample.razor b/src/MudBlazor.Docs/Pages/Components/Button/Examples/ButtonCustomizedExample.razor
index b2ce31dc44dc..d5c60aa1387e 100644
--- a/src/MudBlazor.Docs/Pages/Components/Button/Examples/ButtonCustomizedExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Button/Examples/ButtonCustomizedExample.razor
@@ -3,5 +3,5 @@
- Download Now
-
\ No newline at end of file
+ Download now
+
diff --git a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardHeaderExample.razor b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardHeaderExample.razor
index 85f73002c66c..8be17217367c 100644
--- a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardHeaderExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardHeaderExample.razor
@@ -14,6 +14,6 @@
The quick, brown fox jumps over a lazy dog.
- Read More
+ Read more
diff --git a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardMediaExample.razor b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardMediaExample.razor
index 4842c7dbbd37..585760f5be17 100644
--- a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardMediaExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardMediaExample.razor
@@ -9,6 +9,6 @@
Share
- Learn More
+ Learn more
\ No newline at end of file
diff --git a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardOutlinedExample.razor b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardOutlinedExample.razor
index 7fadf0fa384f..c1246733b0c1 100644
--- a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardOutlinedExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardOutlinedExample.razor
@@ -6,6 +6,6 @@
The quick, brown fox jumps over a lazy dog.
- Learn More
+ Learn more
\ No newline at end of file
diff --git a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardSimpleExample.razor b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardSimpleExample.razor
index 846ae90dd3b9..035ef4b3e93c 100644
--- a/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardSimpleExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Card/Examples/CardSimpleExample.razor
@@ -6,6 +6,6 @@
The quick, brown fox jumps over a lazy dog.
- Learn More
+ Learn more
-
\ No newline at end of file
+
diff --git a/src/MudBlazor.Docs/Pages/Components/Charts/Examples/LineExampleHideLines.razor b/src/MudBlazor.Docs/Pages/Components/Charts/Examples/LineExampleHideLines.razor
index f23e3fb28277..e6ac36919396 100644
--- a/src/MudBlazor.Docs/Pages/Components/Charts/Examples/LineExampleHideLines.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Charts/Examples/LineExampleHideLines.razor
@@ -2,7 +2,7 @@
- Randomize Data
+ Randomize data
@code {
@@ -30,4 +30,4 @@
Series = newSeries;
StateHasChanged();
}
-}
\ No newline at end of file
+}
diff --git a/src/MudBlazor.Docs/Pages/Components/Checkbox/CheckboxPage.razor b/src/MudBlazor.Docs/Pages/Components/Checkbox/CheckboxPage.razor
index 9ad233c9bc81..9c4c173c2aa2 100644
--- a/src/MudBlazor.Docs/Pages/Components/Checkbox/CheckboxPage.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Checkbox/CheckboxPage.razor
@@ -3,7 +3,7 @@
- If you want to let the user turn a setting on or off on demand, a Switch component is recommended instead.
+ Use checkboxes (instead of switches or radio buttons) if multiple options can be selected from a list.
diff --git a/src/MudBlazor.Docs/Pages/Components/Chip/ChipPage.razor b/src/MudBlazor.Docs/Pages/Components/Chip/ChipPage.razor
index a654f109083e..2cd70908d256 100644
--- a/src/MudBlazor.Docs/Pages/Components/Chip/ChipPage.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Chip/ChipPage.razor
@@ -2,7 +2,10 @@
- See also: ChipSet
+
+ Use chips to show options for a specific context.
+ See also: ChipSet
+
diff --git a/src/MudBlazor.Docs/Pages/Components/ColorPicker/ColorPickerPage.razor b/src/MudBlazor.Docs/Pages/Components/ColorPicker/ColorPickerPage.razor
index cfe17c6497d7..28d8c94697ed 100644
--- a/src/MudBlazor.Docs/Pages/Components/ColorPicker/ColorPickerPage.razor
+++ b/src/MudBlazor.Docs/Pages/Components/ColorPicker/ColorPickerPage.razor
@@ -15,7 +15,7 @@
- All parts of the color picker can be removed individually if you just want certain functionality.
+ All parts of the color picker can be removed individually if you only want certain features.
@@ -24,7 +24,7 @@
- The default view can be changed with ColorPickerView and can be useful when you want a minimalistic color picker or force the use of certain colors.
+ The default view can be changed with ColorPickerView. This is useful if you want a minimal color picker or want to restrict the available colors.
@@ -33,7 +33,7 @@
- You can set the default mode of the colorpicker with the ColorPickerMode prop. This can be useful combined with ShowModeSwitch="false" to force the usage of a specific color mode.
+ You can set the default mode of the color picker with the ColorPickerMode property. Combine this with ShowModeSwitch="false" to force a specific color mode.
@@ -42,7 +42,7 @@
- The default palette can be changed with Palette property. The first five colors show up in the quick view when clicking the color preview dot.
+ You can change the default palette with the Palette property. The first five colors appear in the quick view when clicking the color preview dot.
@@ -51,7 +51,7 @@
- You can disable the alpha slider and its textfield counterpart by setting ShowAlpha="false". Doing so will remove any transparency from the color and output RGB, HSL, HEX instead of RGBA, HSLA and HEXA.
+ Disable the alpha slider and its text field by setting ShowAlpha="false". This removes transparency and outputs RGB, HSL, or HEX instead of RGBA, HSLA, or HEXA.
@@ -60,7 +60,7 @@
- Switch Mode lets the user switch betwen RGB, HSL and HEX the button can be disabled with ShowModeSwitch="false", this can be useful if you want to control what type of input/output should be used.
+ Switch Mode lets users switch between RGB, HSL, and HEX. You can disable the button with ShowModeSwitch="false" if you want to control the input/output type.
@@ -88,8 +88,8 @@
- By default, the color picker is modal, preventing interaction with other elements while it is open.
- To allow interactions with other elements, set Modal="false".
+ By default, the color picker is modal, preventing interaction with other elements while open.
+ To allow interaction with other elements, set Modal="false".
@@ -108,7 +108,7 @@
- You can change the elevation with the Elevation parameter. The default level is 8 for Inline, and 0 for Static or Dialog.
+ You can change the elevation with the Elevation parameter. The default is 8 for Inline, and 0 for Static or Dialog.
@@ -126,8 +126,8 @@
- The ThrottleInterval property controls how long to wait until the color is updated while dragging the pointer in the spectrum view.
- If the DragEffect property is set to false, the color selector (circle) will no longer follow the pointer.
+ The ThrottleInterval property controls how long to wait before updating the color while dragging in the spectrum view.
+ If DragEffect is set to false, the color selector (circle) will not follow the pointer.
diff --git a/src/MudBlazor.Docs/Pages/Components/DataGrid/DataGridPage.razor b/src/MudBlazor.Docs/Pages/Components/DataGrid/DataGridPage.razor
index 39604c05a081..acfe972321dd 100644
--- a/src/MudBlazor.Docs/Pages/Components/DataGrid/DataGridPage.razor
+++ b/src/MudBlazor.Docs/Pages/Components/DataGrid/DataGridPage.razor
@@ -125,6 +125,16 @@
In both active modes, single columns can be excluded from sorting by setting the Sortable property to false for that column.
When SortMode is set to SortMode.None sorting is disabled globally and setting the Sortable property on a column has no effect.
You can also use the SortBy parameter on a TemplateColumn to allow sorting on that column.
+
+ When using PropertyColumn, if the Property lambda expression returns a primitive type,
+ the SortDefinition's SortBy will return the Property's nameof value.
+ Instead, if the Property lamda expression contains a complex value, the SortBy will return the column GUID.
+ In this case, if you need to retrieve the column, you have several options:
+
+ - Embed a CellTemplate within the PropertyColumn: Use the lambda expression of the PropertyColumn to return the primitive Property value, while implementing the more complex, ad-hoc logic in the embedded CellTemplate.
+ - Title lookup via GUID: Assign a Title to the TemplateColumn, and a reference to the MudDataGrid using @@ref. Iterate over the RenderedColumns to find the TemplateColumn by matching its unique identifier (where PropertyName == SortDefinition.SortBy), and extract its Title.
+ - Create a custom TemplateColumn: Inherit from the Column base class and override the PropertyName's default behavior and implement your own custom logic instead of relying on a randomly generated identifier
+ Changing the SortMode at runtime will reset any former sort orders on all columns.
diff --git a/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridColumnsPanelExample.razor b/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridColumnsPanelExample.razor
index 4363b75ea13f..da404212c814 100644
--- a/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridColumnsPanelExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridColumnsPanelExample.razor
@@ -33,8 +33,8 @@
- Show All Columns
- Hide All Columns
+ Show all columns
+ Hide all columns
Customize Group TemplateCustomize Group By
- Expand All
- Collapse All
+ Expand all
+ Collapse all
@code {
diff --git a/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridGroupingMultiLevelExample.razor b/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridGroupingMultiLevelExample.razor
index fb75f668d0f1..bfb969022314 100644
--- a/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridGroupingMultiLevelExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridGroupingMultiLevelExample.razor
@@ -126,8 +126,8 @@
Customize Group TemplateCustomize Group By IndustryCustomize Group Style
- Expand All
- Collapse All
+ Expand all
+ Collapse all
@code {
diff --git a/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridServerSideExample.razor b/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridServerSideExample.razor
index 235559fbf09f..26b7c8399349 100644
--- a/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridServerSideExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/DataGrid/Examples/DataGridServerSideExample.razor
@@ -1,5 +1,4 @@
@using System.Net.Http.Json
-@using System.Threading
@using MudBlazor.Examples.Data.Models
@namespace MudBlazor.Docs.Examples
@inject HttpClient httpClient
@@ -14,10 +13,18 @@
-
+
+
+ @(context.Item.Name ?? "-")
+
+
-
+
+
+ @(context.Item.Group ?? "-")
+
+
@@ -66,12 +73,6 @@
o => o.Sign
);
break;
- case nameof(Element.Name):
- data = data.OrderByDirection(
- sortDefinition.Descending ? SortDirection.Descending : SortDirection.Ascending,
- o => o.Name
- );
- break;
case nameof(Element.Position):
data = data.OrderByDirection(
sortDefinition.Descending ? SortDirection.Descending : SortDirection.Ascending,
@@ -84,6 +85,24 @@
o => o.Molar
);
break;
+ case nameof(Element.Group):
+ data = data.OrderByDirection(
+ sortDefinition.Descending ? SortDirection.Descending : SortDirection.Ascending,
+ o => o.Group
+ );
+ break;
+ default:
+ var sortByColumn = dataGrid.RenderedColumns.First(c => c.PropertyName == sortDefinition.SortBy);
+ switch (sortByColumn.Title)
+ {
+ case nameof(Element.Name):
+ data = data.OrderByDirection(
+ sortDefinition.Descending ? SortDirection.Descending : SortDirection.Ascending,
+ o => o.Name
+ );
+ break;
+ }
+ break;
}
}
diff --git a/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DatePickerActionButtonsExample.razor b/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DatePickerActionButtonsExample.razor
index c3573f6aadda..163e8221a3b6 100644
--- a/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DatePickerActionButtonsExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DatePickerActionButtonsExample.razor
@@ -4,7 +4,7 @@
ClearCancel
- Ok
+ OKAutoClose
diff --git a/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DateRangePickerUsageExample.razor b/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DateRangePickerUsageExample.razor
index 2525b1a06bf1..0f92784b961a 100644
--- a/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DateRangePickerUsageExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/DatePicker/Examples/DateRangePickerUsageExample.razor
@@ -11,7 +11,7 @@
ClearCancel
- Ok
+ OKAutoClose
diff --git a/src/MudBlazor.Docs/Pages/Components/DateRangePicker/Examples/DateRangePickerActionButtonsExample.razor b/src/MudBlazor.Docs/Pages/Components/DateRangePicker/Examples/DateRangePickerActionButtonsExample.razor
index 97ecf557ea8d..b37ab3bc1902 100644
--- a/src/MudBlazor.Docs/Pages/Components/DateRangePicker/Examples/DateRangePickerActionButtonsExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/DateRangePicker/Examples/DateRangePickerActionButtonsExample.razor
@@ -6,7 +6,7 @@
ClearCancel
- Ok
+ OKAutoClose
diff --git a/src/MudBlazor.Docs/Pages/Components/Dialog/DialogPage.razor b/src/MudBlazor.Docs/Pages/Components/Dialog/DialogPage.razor
index 96d52fad33f1..ece313732716 100644
--- a/src/MudBlazor.Docs/Pages/Components/Dialog/DialogPage.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Dialog/DialogPage.razor
@@ -1,28 +1,29 @@
@page "/components/dialog"
-
+
+
+ Use dialogs to make sure users act on information.
+
+
-
- Note
- The Dialog is dependent on IDialogService and MudDialogProvider
- Check the Installation page for instructions regarding default setup.
-
+
+ The Dialog component relies on IDialogService and MudDialogProvider for its functionality.
+ See the Installation page for setup instructions.
+
- Suppose you define a MudDialog in TermsOfServiceDialog.razor.
- To show the dialog you simply call:
+ To use a dialog, define a MudDialog in a Razor component (e.g., TermsOfServiceDialog.razor).
+ Show it by calling:
- The advantage of having the dialog in its own Razor component is obviously the ability to reuse it throughout your code-base.
- You can pass parameters to your dialog on show which allow you to load the dialog with custom data.
-
+ This approach lets you reuse dialogs throughout your app and pass parameters for customization.
- Note: Even though it is technically possible to show any razor component as a dialog it is highly recommended to use a MudDialog as the top-level of your dialogs!
+ Tip: For best results, use MudDialog as the root element of your dialog component.
@@ -34,14 +35,14 @@
- The dialog's default behavior can be changed in two ways, either globally with parameters in the <MudDialogProvider/> or pass down the DialogOptions class when you open the dialog.
+ You can change dialog behavior globally by setting parameters on <MudDialogProvider/>, or per dialog by passing a DialogOptions instance when opening a dialog.
- In the file where you added <MudDialogProvider/>, we can pass down different options as parameters. See installation page for more information regarding this.
+ Set options on <MudDialogProvider/> to affect all dialogs. See the installation page for details.
@@ -49,7 +50,7 @@
- Below we pass along the DialogOptions class when we open the dialog, this can be done per dialog or you can predefine a bunch of them that you use for specific cases in your system.
+ Pass a DialogOptions object when opening a dialog to override global settings for that instance.
@@ -60,7 +61,7 @@
- The title and the options can also be modified from the dialog component itself by calling SetTitle and SetOptions on the MudDialogInstance object.
+ You can update the dialog's title and options from within the dialog component using SetTitle and SetOptions on the MudDialogInstance.
@@ -73,7 +74,7 @@
- In this section, we will demonstrate how you can build one dialog and reuse it for multiple purposes.
+ Build a reusable dialog and pass simple data to it for different scenarios.
@@ -82,7 +83,7 @@
- Here is a little more advanced use case. We will use the same dialog but feed it with different server data and then mimic a delete operation.
+ Pass data to a dialog and use it for operations, such as confirming a delete action.
@@ -91,7 +92,7 @@
- Quick example on how content that exeeds the available height becomes scrollable.
+ Dialogs automatically become scrollable if their content exceeds the available height.
@@ -100,7 +101,7 @@
- Dialog background can be changed via BackgroundClass dialog option.
+ Customize the dialog background using the BackgroundClass option.
@@ -110,10 +111,7 @@
- You can inline MudDialog directly in another component which, of course, makes most sense for small dialogs that are not re-used somewhere else.
- The advantage is that you can easily share code and data between dialog and owning component via bindings.
-
- This example also shows how to override the dialog title with a render fragment.
+ You can place a MudDialog directly in another component. This is useful for small, non-reusable dialogs and allows easy sharing of data and code. You can also override the dialog title with a render fragment.
@@ -124,8 +122,7 @@
- You can inline a MudDialog within another MudDialog, even in another inline dialog. This example shows both ways of nesting
- an inline dialog.
+ Inline dialogs can be nested within each other. This example demonstrates both single and multiple levels of nesting.
@@ -136,9 +133,7 @@
- It is possible to open multiple dialogs at the same time.
-
- This example also shows how to open a second dialog and cancel all dialogs at once.
+ You can open multiple dialogs at once. This example also shows how to open a second dialog and close all dialogs simultaneously.
@@ -149,11 +144,9 @@
- Out of the box MudDialog supports the Escape key to close a dialog if you set option @(nameof(DialogOptions.CloseOnEscapeKey)).
- Note that @(nameof(DialogOptions.CloseOnEscapeKey)) will close the dialog with DialogResult.Cancel().
-
- If you need more than that or a different behavior you can define your own event handlers with OnKeyDown and OnKeyUp.
- In this example we return the selected value on Enter only if a value has been selected.
+ MudDialog supports closing with the Escape key if @(nameof(DialogOptions.CloseOnEscapeKey)) is enabled.
+ When closed with Escape, the dialog returns DialogResult.Cancel().
+ For custom keyboard handling, use OnKeyDown and OnKeyUp event handlers. The example below returns a value on Enter only if a selection is made.
@@ -164,7 +157,7 @@
- Dialog uses the FocusTrap-Component to keep the keyboard-focus within. By default, the first element is focused With DefaultFocus you can change the behaviour to, for example, focus the last element.
+ Dialogs use a focus trap to keep keyboard focus inside. By default, the first element is focused, but you can change this with the DefaultFocus option.
@@ -175,7 +168,7 @@
- Classes can be applied to the title, content, and action button sections, or the dialog itself, to make customization easier.
+ You can apply custom classes to the dialog's title, content, actions, or the dialog itself for advanced styling.
diff --git a/src/MudBlazor.Docs/Pages/Components/Dialog/Examples/DialogBlurryExample.razor b/src/MudBlazor.Docs/Pages/Components/Dialog/Examples/DialogBlurryExample.razor
index c656b76b2b1f..87d46452c3a2 100644
--- a/src/MudBlazor.Docs/Pages/Components/Dialog/Examples/DialogBlurryExample.razor
+++ b/src/MudBlazor.Docs/Pages/Components/Dialog/Examples/DialogBlurryExample.razor
@@ -4,7 +4,7 @@
- Open Simple Dialog
+ Open blurry dialog
@code {
+
private const string ExpandAllIcon = """""";
private const string CollapseAllIcon = """""";
@@ -171,7 +171,7 @@
private string ThemeIcon => _isDarkMode ? Icons.Material.Filled.LightMode : Icons.Material.Filled.DarkMode;
- private string ThemeLabel => _isDarkMode ? "Switch to light theme" : "Switch to dark theme";
+ private string ThemeLabel => _isDarkMode ? "Light mode" : "Dark mode";
private void DocsDrawerToggle() => _drawerOpen = !_drawerOpen;
@@ -198,6 +198,71 @@
type => type,
type => type.Namespace?.Split('.').LastOrDefault() ?? string.Empty
);
+
+ ParseQueryString();
+ NavManager.LocationChanged += HandleLocationChanged;
+ }
+
+ private void HandleLocationChanged(object? sender, LocationChangedEventArgs e)
+ {
+ ParseQueryString();
+ StateHasChanged();
+ }
+
+ public void Dispose()
+ {
+ NavManager.LocationChanged -= HandleLocationChanged;
+ }
+
+ private void ParseQueryString()
+ {
+ var uri = new Uri(NavManager.Uri);
+ var query = uri.Query;
+
+ if (string.IsNullOrEmpty(query))
+ return;
+
+ if (query.StartsWith('?'))
+ query = query.Substring(1);
+
+ var queryParams = query.Split('&');
+
+ foreach (var param in queryParams)
+ {
+ var parts = param.Split('=');
+ if (parts.Length == 2)
+ {
+ var key = parts[0];
+ var value = Uri.UnescapeDataString(parts[1]);
+
+ if (string.Equals(key, "component", StringComparison.OrdinalIgnoreCase))
+ {
+ var componentType = _availableComponentTypes.FirstOrDefault(t =>
+ t.Name.Equals(value, StringComparison.OrdinalIgnoreCase));
+
+ if (componentType != null)
+ {
+ _selectedType = componentType;
+ StateHasChanged();
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ private void UpdateQueryString(Type componentType)
+ {
+ if (componentType == null) return;
+
+ var uri = new Uri(NavManager.Uri);
+ var baseUrl = uri.GetLeftPart(UriPartial.Path);
+
+ // Create the new query string
+ var newUrl = $"{baseUrl}?component={componentType.Name}";
+
+ // Update URL without navigation (false parameter)
+ NavManager.NavigateTo(newUrl, false);
}
private RenderFragment TestComponent() => builder =>
@@ -254,6 +319,7 @@
}
_selectedType = entry;
+ UpdateQueryString(entry);
await Task.Yield();
await _autocomplete.ClearAsync();
}
diff --git a/src/MudBlazor.UnitTests.Viewer/Shared/MainLayout.razor b/src/MudBlazor.UnitTests.Viewer/Shared/MainLayout.razor
index dc0145162ed6..311af89bd931 100644
--- a/src/MudBlazor.UnitTests.Viewer/Shared/MainLayout.razor
+++ b/src/MudBlazor.UnitTests.Viewer/Shared/MainLayout.razor
@@ -5,10 +5,3 @@
@Body
-
-@code {
- static MainLayout()
- {
- MudGlobal.TooltipDefaults.Delay = TimeSpan.FromMilliseconds(500);
- }
-}
diff --git a/src/MudBlazor.UnitTests.Viewer/Shared/MainLayoutTwo.razor b/src/MudBlazor.UnitTests.Viewer/Shared/MainLayoutTwo.razor
new file mode 100644
index 000000000000..fc486a9b4dc2
--- /dev/null
+++ b/src/MudBlazor.UnitTests.Viewer/Shared/MainLayoutTwo.razor
@@ -0,0 +1,11 @@
+@inherits LayoutComponentBase
+
+
+
+
+
+@Body
+
+@code {
+ private readonly MudTheme _customTheme = new();
+}
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridColumnGroupingTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridColumnGroupingTest.razor
index 4e6ba3996f66..5ee10426a34d 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridColumnGroupingTest.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridColumnGroupingTest.razor
@@ -1,16 +1,25 @@
-
-
+
+
-Group By Gender
-Group By Age
-Group By Profession
+Group By Name
+Group By Gender
+Group By Age
+Group By Profession
+UnGroup All
+
+
+
@code {
private readonly Func _groupByProfession = x => string.IsNullOrEmpty(x.Profession)
@@ -33,6 +42,14 @@
new("Alice", 32, "Female", "Cook")
];
+ private void GroupByName(MouseEventArgs args)
+ {
+ IsNameGrouped = true;
+ IsProfessionGrouped = false;
+ IsAgeGrouped = false;
+ IsGenderGrouped = false;
+ }
+
private void GroupByGender(MouseEventArgs args)
{
IsNameGrouped = false;
@@ -55,7 +72,15 @@
IsProfessionGrouped = true;
IsAgeGrouped = false;
IsGenderGrouped = false;
- }
+ }
+
+ private void UnGroupAll(MouseEventArgs args)
+ {
+ IsNameGrouped = false;
+ IsProfessionGrouped = false;
+ IsAgeGrouped = false;
+ IsGenderGrouped = false;
+ }
public record Model(string Name, int Age, string Gender, string? Profession);
}
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridGroupByNullTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridGroupByNullTest.razor
new file mode 100644
index 000000000000..bd8a62fb3ca1
--- /dev/null
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridGroupByNullTest.razor
@@ -0,0 +1,50 @@
+
+
+ Fruits
+
+
+
+
+
+
+
+ Category: @context.Grouping.Key
+
+
+
+
+
+
+ Add Fruit
+ Add Null Fruit
+
+
+@code {
+ private MudDataGrid _dataGrid = null!;
+ private readonly List _fruits =
+ [
+ new Fruit("Apple", 2, "Pome"),
+ new Fruit("Pear", 4, "Pome"),
+ new Fruit("Orange", 4, "Citrus")
+ ];
+
+ public void AddFruit()
+ {
+ _fruits.Add(new Fruit("Banana", 5, "Musa"));
+ }
+
+ public void AddNullFruit()
+ {
+ _fruits.Add(new Fruit("NullFruit", 3, null));
+ }
+
+ public class Fruit(string name, int count, string? category)
+ {
+ public string Name { get; set; } = name;
+
+ public int Count { get; set; } = count;
+
+ public string? Category { get; set; } = category;
+ }
+}
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCloseDateRangePickerTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCloseDateRangePickerTest.razor
index 754aaee90923..e263725a6541 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCloseDateRangePickerTest.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCloseDateRangePickerTest.razor
@@ -4,7 +4,7 @@
ClearCancel
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCompleteDatePickerTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCompleteDatePickerTest.razor
index 9573115a37a6..ac1fb8d0d8c3 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCompleteDatePickerTest.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/AutoCompleteDatePickerTest.razor
@@ -4,7 +4,7 @@
ClearCancel
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DatePickerStaticTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DatePickerStaticTest.razor
index da7dac2345ba..d1d9119ce6c8 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DatePickerStaticTest.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DatePickerStaticTest.razor
@@ -4,7 +4,7 @@
ClearCancel
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DateRangePickerValidationTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DateRangePickerValidationTest.razor
index fa4521b287b9..42f64eed0c35 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DateRangePickerValidationTest.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/DateRangePickerValidationTest.razor
@@ -9,7 +9,7 @@
ClearCancel
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/SimpleMudDatePickerTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/SimpleMudDatePickerTest.razor
index 53038742b4f2..01682d103057 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/SimpleMudDatePickerTest.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/DatePicker/SimpleMudDatePickerTest.razor
@@ -16,7 +16,8 @@
FixYear="@FixYear"
MinDate="@MinDate"
MaxDate="@MaxDate"
- AdditionalDateClassesFunc="@AdditionalDateClassesFunc" />
+ AdditionalDateClassesFunc="@AdditionalDateClassesFunc"
+ Culture="@(new CultureInfo("en-US"))" />
}
else
{
@@ -31,7 +32,8 @@ else
FixYear="@FixYear"
MinDate="@MinDate"
MaxDate="@MaxDate"
- AdditionalDateClassesFunc="@AdditionalDateClassesFunc" />
+ AdditionalDateClassesFunc="@AdditionalDateClassesFunc"
+ Culture="@(new CultureInfo("en-US"))" />
}
@code {
@@ -81,4 +83,4 @@ else
public async Task Open() => await InvokeAsync(() => _picker.OpenAsync());
public async Task Close() => await InvokeAsync(() => _picker.CloseAsync());
-}
\ No newline at end of file
+}
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOkCancel.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOkCancel.razor
index c8438e784696..f92d8e475e57 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOkCancel.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOkCancel.razor
@@ -4,8 +4,8 @@
Cancel
- Ok
- Ok Default
+ OK
+ OK Default
@@ -26,4 +26,4 @@
private void OnKeyDown(KeyboardEventArgs arg) => LastKeyDown = arg;
private void OnKeyUp(KeyboardEventArgs arg) => LastKeyUp = arg;
-}
\ No newline at end of file
+}
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOptionMutation.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOptionMutation.razor
index b59b8f1abf50..70e471cb8384 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOptionMutation.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogOptionMutation.razor
@@ -10,7 +10,7 @@
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogRender.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogRender.razor
index cab1bdfa86fe..f744ff86e7b6 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogRender.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogRender.razor
@@ -4,7 +4,7 @@
Cancel
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogThatUpdatesItsTitle.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogThatUpdatesItsTitle.razor
index 254deb2276ef..69c8b41f0866 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogThatUpdatesItsTitle.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogThatUpdatesItsTitle.razor
@@ -7,7 +7,7 @@
Cancel
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogToggleFullscreen.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogToggleFullscreen.razor
index 380969964ba6..e8399e2d036d 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogToggleFullscreen.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogToggleFullscreen.razor
@@ -1,11 +1,11 @@
-
+
Toggle FullScreen
- Ok
+ OK
@code {
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallback.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallback.razor
index 87314f977ed8..34245383c868 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallback.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallback.razor
@@ -8,7 +8,7 @@
Cancel
- Ok
+ OK
diff --git a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallbackTest.razor b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallbackTest.razor
index 6ab9ed9eb231..74161663a471 100644
--- a/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallbackTest.razor
+++ b/src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/DialogWithEventCallbackTest.razor
@@ -1,7 +1,7 @@
@inject IDialogService DialogService
- Open Simple Dialog
+ Open simple dialog