forked from MudBlazor/MudBlazor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MudExpansionPanel: Use ParameterState, remove obsolete API and change…
… to async API (MudBlazor#8446)
- Loading branch information
1 parent
61e8a76
commit ab608c2
Showing
11 changed files
with
250 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ | |
Panel Two Content | ||
</MudExpansionPanel> | ||
</MudExpansionPanels> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,3 @@ | |
Panel Three Content | ||
</MudExpansionPanel> | ||
</MudExpansionPanels> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,3 @@ | |
Panel Three Content | ||
</MudExpansionPanel> | ||
</MudExpansionPanels> | ||
|
||
|
||
|
9 changes: 3 additions & 6 deletions
9
...tTests.Viewer/TestComponents/ExpansionPanel/ExpansionPanelStartExpandedMultipleTest.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
@namespace MudBlazor.UnitTests.TestComponents | ||
|
||
<MudExpansionPanels MultiExpansion> | ||
<MudExpansionPanel Class="panel-one" Text="Panel One" IsInitiallyExpanded> | ||
<MudExpansionPanel Class="panel-one" Text="Panel One" IsExpanded="true"> | ||
Panel One Content | ||
</MudExpansionPanel> | ||
<MudExpansionPanel Class="panel-two" Text="Panel Two" IsInitiallyExpanded> | ||
<MudExpansionPanel Class="panel-two" Text="Panel Two" IsExpanded="true"> | ||
Panel Two Content | ||
</MudExpansionPanel> | ||
<MudExpansionPanel Class="panel-three" Text="Panel Three" IsInitiallyExpanded> | ||
<MudExpansionPanel Class="panel-three" Text="Panel Three" IsExpanded="true"> | ||
Panel Three Content | ||
</MudExpansionPanel> | ||
</MudExpansionPanels> | ||
|
||
|
||
|
12 changes: 9 additions & 3 deletions
12
...azor.UnitTests.Viewer/TestComponents/ExpansionPanel/ExpansionPanelStartExpandedTest.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
@namespace MudBlazor.UnitTests.TestComponents | ||
|
||
<MudExpansionPanels> | ||
<MudExpansionPanel Class="panel-one" Text="Panel One"> | ||
<MudExpansionPanel @bind-IsExpanded="Panel1IsExpanded" Class="panel-one" Text="Panel One"> | ||
Panel One Content | ||
</MudExpansionPanel> | ||
<MudExpansionPanel Class="panel-two" Text="Panel Two" IsInitiallyExpanded> | ||
<MudExpansionPanel @bind-IsExpanded="Panel2IsExpanded" Class="panel-two" Text="Panel Two"> | ||
Panel Two Content | ||
</MudExpansionPanel> | ||
<MudExpansionPanel Class="panel-three" Text="Panel Three"> | ||
<MudExpansionPanel @bind-IsExpanded="Panel3IsExpanded" Class="panel-three" Text="Panel Three"> | ||
Panel Three Content | ||
</MudExpansionPanel> | ||
</MudExpansionPanels> | ||
|
||
@code | ||
{ | ||
public bool Panel1IsExpanded { get; set; } | ||
|
||
public bool Panel2IsExpanded { get; set; } = true; | ||
|
||
public bool Panel3IsExpanded { get; set; } | ||
} |
46 changes: 46 additions & 0 deletions
46
...azor.UnitTests.Viewer/TestComponents/ExpansionPanel/ExpansionPanelTwoWayBIndingTest.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@namespace MudBlazor.UnitTests.TestComponents | ||
|
||
<MudExpansionPanels> | ||
<MudExpansionPanel @bind-IsExpanded="Expansion[0]" Text="Panel One" MaxHeight="150"> | ||
Panel One Content | ||
</MudExpansionPanel> | ||
<MudExpansionPanel @bind-IsExpanded="Expansion[1]" Text="Panel Two" MaxHeight="500"> | ||
Panel Two Content | ||
</MudExpansionPanel> | ||
<MudExpansionPanel @bind-IsExpanded="Expansion[2]" Text="Panel Three" MaxHeight="1000"> | ||
Panel Three Content | ||
</MudExpansionPanel> | ||
<MudExpansionPanel @bind-IsExpanded="Expansion[3]" Text="Panel Four"> | ||
Panel Four Content | ||
</MudExpansionPanel> | ||
</MudExpansionPanels> | ||
|
||
@code { | ||
public bool[] Expansion = [true, false, false, false]; | ||
|
||
public void ToggleExpansion1() | ||
{ | ||
// Simulating MudSwitch toggle, we need StateHasChanged. | ||
// Usually it would be updated from an EventCallback (or bind syntax) that updates the UI automatically but we doing it directly. | ||
Expansion[0] = !Expansion[0]; | ||
StateHasChanged(); | ||
} | ||
|
||
public void ToggleExpansion2() | ||
{ | ||
Expansion[1] = !Expansion[1]; | ||
StateHasChanged(); | ||
} | ||
|
||
public void ToggleExpansion3() | ||
{ | ||
Expansion[2] = !Expansion[2]; | ||
StateHasChanged(); | ||
} | ||
|
||
public void ToggleExpansion4() | ||
{ | ||
Expansion[3] = !Expansion[3]; | ||
StateHasChanged(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.