-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dev-v5] Add checkbox component #3223
Merged
dvoituron
merged 10 commits into
microsoft:dev-v5
from
AClerbois:users/aclerbois/dev-v5/fluentcheckbox
Feb 11, 2025
Merged
[dev-v5] Add checkbox component #3223
dvoituron
merged 10 commits into
microsoft:dev-v5
from
AClerbois:users/aclerbois/dev-v5/fluentcheckbox
Feb 11, 2025
Conversation
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
dvoituron
requested changes
Jan 21, 2025
d4d01fc
to
a7bc5aa
Compare
dvoituron
requested changes
Jan 22, 2025
.../Demo/FluentUI.Demo.Client/Documentation/Components/Checkbox/Examples/CheckboxDisabled.razor
Show resolved
Hide resolved
dvoituron
requested changes
Jan 22, 2025
a3d905c
to
7ffc94d
Compare
99c37b7
to
b5aabc5
Compare
dvoituron
requested changes
Feb 10, 2025
...mo/FluentUI.Demo.Client/Documentation/Components/Checkbox/Examples/CheckboxAppearances.razor
Outdated
Show resolved
Hide resolved
...les/Demo/FluentUI.Demo.Client/Documentation/Components/Checkbox/Examples/CheckboxSizes.razor
Outdated
Show resolved
Hide resolved
.../FluentUI.Demo.Client/Documentation/Components/Checkbox/Examples/CheckboxIndeterminate.razor
Outdated
Show resolved
Hide resolved
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Checkbox/FluentCheckbox.md
Outdated
Show resolved
Hide resolved
dvoituron
requested changes
Feb 10, 2025
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. WIP Add unit testing
65e7787
to
24d438a
Compare
291c855
to
7152011
Compare
Updated FluentCheckbox.md to clarify indeterminate state usage, including `CheckState` property and `ShowIndeterminate` attribute. Changed error handling in FluentCheckbox.razor.cs to throw `ArgumentOutOfRangeException` for invalid boolean values. Simplified `SetCheckStateChangedAsync` method using null-coalescing operator.
Updated FluentCheckbox component: - Added properties: CheckState (nullable bool), Shape (default: Square), Size (default: Medium) - Removed and redefined properties: Shape, CheckState, Size - Added TryParseValueFromString method throwing NotSupportedException - Added InternalTryParseValueFromString method for parsing logic - Updated SetCheckStateChangedAsync to remove equality check Testing updates: - Added FluentCheckbox_TryParseValueFromString test - Refactored existing tests for readability and maintainability - Removed unused test FluentCheckbox_ToTextInputAppearance
Replaced `cut.MarkupMatches` with `cut.Verify` in `FluentCheckboxTests.razor` to simplify assertions. Updated verified HTML files to include expected markup for various `FluentCheckbox` configurations, ensuring accurate comparisons in tests.
This commit removes the `StartTemplate` and `EndTemplate` parameters and their associated rendering logic from the `FluentCheckbox` component. Changes include: - Deleting the `StartTemplate` and `EndTemplate` properties from `FluentCheckbox.razor.cs`. - Removing the conditional rendering of `StartTemplate` and `EndTemplate` in `FluentCheckbox.razor`. - Updating the closing tag of the `fluent-checkbox` element to be self-closing. - Removing the test case `FluentCheckbox_StartEndTemplate` from `FluentCheckboxTests.razor`. - Deleting the corresponding verification HTML for the removed test case in `FluentCheckboxTests.FluentCheckbox_StartEndTemplate.verified.razor.html`.
Replaced <fluent-label> with <label> in FluentCheckbox tests. Added Blazor-specific attributes to <fluent-checkbox>. Fixed rendering syntax in FluentCheckbox_LabelTemplate test.
dvoituron
approved these changes
Feb 11, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[dev-v5] Add checkbox component
A
FluentCheckbox
component enables a user to select or deselect an option. It's typically used to capture a boolean value.To define the indeterminate state, you need to use the
CheckState
bindable property, which has three possible values:null
,true
andfalse
.Unit Tests
Updated