-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CheckboxThreeStates and FluentCheckbox components
Updated CheckboxThreeStates.razor to include additional FluentCheckbox components and modify existing ones. Renamed variables and added new ones in the @code section. Modified OnInitializedAsync and SetCheckStateChangedAsync methods in FluentCheckbox.razor.cs to handle value changes more effectively.
- Loading branch information
Showing
2 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
37 changes: 32 additions & 5 deletions
37
...FluentUI.Demo.Client/Documentation/Components/Checkbox/Examples/CheckboxThreeStates.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,17 +1,44 @@ | ||
<div> | ||
<FluentCheckbox @bind-CheckState="checkState" | ||
<FluentCheckbox @bind-CheckState="checkState1" | ||
@bind-Value="value1" | ||
ThreeState="true" | ||
Label="Three state" /> | ||
- CheckState is @(checkState is null ? "(null indeterminate)" : checkState.Value ? "checked" : "unchecked") | ||
Label="Three state = true" /> | ||
<span style="width: 50px; display: inline-block" /> | ||
Value = @value1- CheckState is @(checkState1 is null ? "(null indeterminate)" : checkState1.Value.ToString()) | ||
<br /> | ||
|
||
<FluentCheckbox @bind-Value="value2" | ||
ThreeState="false" | ||
Label="Three state = false" /> | ||
<span style="width: 50px; display: inline-block" /> | ||
Value = @value2 | ||
<br /> | ||
<FluentCheckbox @bind-CheckState="checkStateThreeStateOrderUncheckToIntermediate" | ||
@bind-Value="valueThreeStateOrderUncheckToIntermediate" | ||
ThreeState="true" | ||
ThreeStateOrderUncheckToIntermediate="true" | ||
Label="Three state with order uncheck to intermediate" /> | ||
- CheckState is @(checkStateThreeStateOrderUncheckToIntermediate is null ? "(null indeterminate)" : checkStateThreeStateOrderUncheckToIntermediate.Value ? "checked" : "unchecked") | ||
<span style="width: 50px; display: inline-block" /> | ||
Value: @valueThreeStateOrderUncheckToIntermediate - CheckState is | ||
@(checkStateThreeStateOrderUncheckToIntermediate is null ? "(null indeterminate)" : checkStateThreeStateOrderUncheckToIntermediate.Value.ToString()) | ||
|
||
<br /> | ||
<FluentCheckbox @bind-CheckState="checkStateShowIntermediateWithThreeState" | ||
@bind-Value="valueShowIntermediateWithThreeState" | ||
ThreeState="true" | ||
ThreeStateOrderUncheckToIntermediate="true" | ||
Label="Three state with show intermediate" /> | ||
<span style="width: 50px; display: inline-block" /> | ||
Value: @valueShowIntermediateWithThreeState - CheckState is | ||
@(checkStateShowIntermediateWithThreeState is null ? "(null indeterminate)" : checkStateShowIntermediateWithThreeState.Value.ToString()) | ||
</div> | ||
|
||
@code { | ||
private bool? checkState = true; | ||
private bool? checkState1 = true; | ||
private bool value1 = false; | ||
private bool value2 = false; | ||
private bool? checkStateThreeStateOrderUncheckToIntermediate = false; | ||
private bool valueThreeStateOrderUncheckToIntermediate = false; | ||
private bool valueShowIntermediateWithThreeState = false; | ||
private bool? checkStateShowIntermediateWithThreeState = false; | ||
} |
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