Skip to content

Comments

Add new Icon parameter to BitDatePicker (#12082)#12083

Merged
msynk merged 3 commits intobitfoundation:developfrom
msynk:12082-blazorui-datepicker-new-icon
Feb 13, 2026
Merged

Add new Icon parameter to BitDatePicker (#12082)#12083
msynk merged 3 commits intobitfoundation:developfrom
msynk:12082-blazorui-datepicker-new-icon

Conversation

@msynk
Copy link
Member

@msynk msynk commented Feb 13, 2026

closes #12082

Summary by CodeRabbit

  • New Features

    • DatePicker now supports external icon libraries (FontAwesome, Bootstrap Icons) via a new Icon parameter; takes precedence over IconName when both are set.
  • Bug Fixes

    • Fixed hidden character formatting issues in component files.
  • Documentation

    • Updated demo examples showcasing external icon integration with DatePicker.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The changes implement support for external icon libraries in the BitDatePicker component through a new Icon parameter of type BitIconInfo?. The icon rendering logic is refactored to use computed icon objects, icon precedence rules are established (Icon over IconName), and demonstration examples are added showcasing Font Awesome and Bootstrap Icons integration alongside updated documentation.

Changes

Cohort / File(s) Summary
Core Component Implementation
src/BlazorUI/Bit.BlazorUI/Components/Inputs/DatePicker/BitDatePicker.razor, src/BlazorUI/Bit.BlazorUI/Components/Inputs/DatePicker/BitDatePicker.razor.cs
Added new public parameter Icon of type BitIconInfo? with precedence over IconName. Refactored icon rendering to use computed icon object via BitIconInfo.From() and CSS classes derived from @icon?.GetCssClasses(). Removed BOM character. Fixed calendar icon fallback to "CalendarMirrored" when IconName is null.
Demo and Documentation
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/DatePicker/BitDatePickerDemo.razor, src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/DatePicker/BitDatePickerDemo.razor.cs, src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/DatePicker/BitDatePickerDemo.razor.samples.cs
Added "External Icons" demo showcasing Font Awesome and Bootstrap Icons via the Icon parameter. Moved "Style & Class" demo to example16, shifted RTL demo to example17. Updated parameter documentation and renamed sample code identifiers (example15/16/17) to reflect new sequencing. Removed BOM character from samples file.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A calendar hops with icons galore,
Font Awesome and Bootstrap at the door!
External libraries now join the fray,
DatePicker sparkles in a brand new way.
Icons take precedence, precedence takes the day! ✨

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Add new Icon parameter to BitDatePicker (#12082)' clearly and specifically describes the main change—adding a new Icon parameter to the BitDatePicker component.
Linked Issues check ✅ Passed The pull request successfully implements the Icon parameter for BitDatePicker to support external icons, matching the objective from issue #12082 to enable external icon usage in the component.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the Icon parameter feature; BOM character removals and demo updates are necessary supporting changes directly related to the main objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/DatePicker/BitDatePickerDemo.razor.cs`:
- Around line 152-159: The componentSubClasses list is missing documentation for
the BitIconInfo type referenced by the parameter with Href = "#bit-icon-info";
add a new componentSubClass entry with Id = "bit-icon-info", Name =
"BitIconInfo", Description summarizing the BitIconInfo fields (or mirror the
pattern used in BitMenuButtonDemo.razor.cs), and LinkType/other metadata so the
anchor exists for the DatePicker parameter, or alternatively remove the Href
from the parameter if you intend not to document BitIconInfo; update the
componentSubClasses collection in BitDatePickerDemo.razor.cs accordingly.

@msynk msynk merged commit 8e4d218 into bitfoundation:develop Feb 13, 2026
3 checks passed
@msynk msynk deleted the 12082-blazorui-datepicker-new-icon branch February 13, 2026 15:44
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

The new Icon implementation for the BitDatePicker component

1 participant