Skip to content

Add select component#78

Merged
albx merged 13 commits intomainfrom
feature/38-select-component
Feb 12, 2026
Merged

Add select component#78
albx merged 13 commits intomainfrom
feature/38-select-component

Conversation

@albx
Copy link
Owner

@albx albx commented Feb 8, 2026

This pull request introduces a new, fully-featured select field component (BitSelectField) for forms in the BitBlazor library. The implementation includes support for grouped options, disabled states, custom option rendering, and additional accessibility and customization features. Comprehensive tests and Storybook stories are also added to demonstrate and verify the new component's behavior.

New Select Field Component and Supporting Elements:

  • Added BitSelectField<T> component, which provides a customizable and accessible select field for forms, supporting templated options and option groups. (src/BitBlazor/Form/SelectField/BitSelectField.razor, src/BitBlazor/Form/SelectField/BitSelectField.razor.cs, src/BitBlazor/Form/SelectField/IBitSelectField.csR1-R11)
  • Introduced BitSelectItem<TValue> and BitSelectItemGroup components for defining selectable options and logically grouped options within the select field. (src/BitBlazor/Form/SelectField/BitSelectItem.razor, src/BitBlazor/Form/SelectField/BitSelectItem.razor.cs, src/BitBlazor/Form/SelectField/BitSelectItemGroup.razor, src/BitBlazor/Form/SelectField/BitSelectItemGroup.razor.cs)
  • Created internal marker interface IBitSelectField for internal type safety and cascading parameters.

Testing and Documentation:

Core and Infrastructure Improvements:

  • Improved validation logic in BitFormComponentBase<T> to allow components with empty SupportedTypes arrays.
  • Minor documentation formatting update in BitComponentBase.
  • Updated solution file for compatibility with Visual Studio 2022 v18.
  • Fixed test base class inheritance for consistency. (tests/BitBlazor.Test/Components/Breadcrumb/BitBreadcrumbTest.Rendering.razor, tests/BitBlazor.Test/Components/Breadcrumb/BitBreadcrumbTest.Rendering.razorL1-R1)

@albx albx linked an issue Feb 8, 2026 that may be closed by this pull request
@albx albx marked this pull request as ready for review February 8, 2026 17:22
@albx albx requested a review from Copilot February 8, 2026 17:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new BitSelectField<T> form component to BitBlazor (with option and option-group child components), plus tests, Storybook stories, and documentation to support and demonstrate the new select field.

Changes:

  • Introduces BitSelectField<T>, BitSelectItem<TValue>, and BitSelectItemGroup (plus an internal marker interface for cascading/type-safety).
  • Adds rendering tests and Storybook stories for default/disabled/grouped scenarios.
  • Updates docs and a few infrastructure items (base validation logic, Storybook package versions, solution metadata).

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
src/BitBlazor/Form/SelectField/BitSelectField.razor Implements the select field markup using InputSelect and cascades the parent to child option components.
src/BitBlazor/Form/SelectField/BitSelectField.razor.cs Adds the select field component class and container CSS composition.
src/BitBlazor/Form/SelectField/BitSelectItem.razor Renders an <option> for use inside BitSelectField.
src/BitBlazor/Form/SelectField/BitSelectItem.razor.cs Defines option parameters (value/disabled/attributes).
src/BitBlazor/Form/SelectField/BitSelectItemGroup.razor Renders an <optgroup> for grouping select options.
src/BitBlazor/Form/SelectField/BitSelectItemGroup.razor.cs Defines optgroup parameters (label/disabled/attributes).
src/BitBlazor/Form/SelectField/IBitSelectField.cs Adds internal marker interface for cascading/typing.
src/BitBlazor/Form/BitFormComponentBase.cs Adjusts supported-type validation to allow “no restriction” (empty SupportedTypes).
src/BitBlazor/Core/BitComponentBase.cs Minor documentation formatting update.
tests/BitBlazor.Test/Form/SelectField/BitSelectFieldTest.Rendering.razor Adds rendering tests for BitSelectField scenarios.
tests/BitBlazor.Test/Components/Breadcrumb/BitBreadcrumbTest.Rendering.razor Aligns test base inheritance (BunitContext).
stories/BitBlazor.Stories/Components/Stories/Form/BitSelectField.stories.razor Adds Storybook stories demonstrating the new component.
stories/BitBlazor.Stories/BitBlazor.Stories.csproj Updates Storybook-related package versions.
docs/form/select-field.md Adds dedicated documentation page for BitSelectField.
docs/form/form-components.md Adds BitSelectField to the form components index and examples.
docs/quick-reference.md Adds quick reference examples using BitSelectField.
docs/README.md Adds BitSelectField to docs landing page list.
BitBlazor.sln Updates solution metadata for newer Visual Studio version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 9, 2026

@albx I've opened a new pull request, #79, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 9, 2026

@albx I've opened a new pull request, #80, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits February 9, 2026 16:22
Co-authored-by: albx <5121303+albx@users.noreply.github.com>
Co-authored-by: albx <5121303+albx@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Feb 10, 2026

@albx I've opened a new pull request, #81, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 11, 2026

@albx I've opened a new pull request, #82, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits February 12, 2026 17:08
Co-authored-by: albx <5121303+albx@users.noreply.github.com>
…move unnecessary null-forgiving operators

Co-authored-by: albx <5121303+albx@users.noreply.github.com>
@albx albx merged commit bee3b50 into main Feb 12, 2026
4 checks passed
@albx albx deleted the feature/38-select-component branch February 12, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add select component

2 participants