Show missing required asterisk in BitCircularTimePicker's label (#9890)#9892
Conversation
WalkthroughThe pull request adds a new Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant CTP as BitCircularTimePicker
participant CS as ClassBuilder
participant FH as Form Handler
U->>CTP: Interact with time picker
Note right of CTP: Input renders with "required" attribute if Required is true
CTP->>CS: Register CSS class ("bit-ctp-req") if IsEnabled and Required
U->>FH: Submit form
FH->>CTP: Validate input (HTML5 required check)
Note right of FH: Introduces a delay to simulate processing
FH->>U: Return submission success
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/CircularTimePicker/BitCircularTimePickerDemo.razor (1)
5-222: 🛠️ Refactor suggestionAdd Required property to the component parameters documentation.
The
Requiredproperty should be documented in thecomponentParameterslist to maintain comprehensive API documentation.Add this entry to the componentParameters list:
private readonly List<ComponentParameter> componentParameters = [ + new() + { + Name = "Required", + Type = "bool", + DefaultValue = "false", + Description = "Whether the TimePicker is required and displays an asterisk in the label.", + }, // ... existing parameters ];
🧹 Nitpick comments (1)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.scss (1)
393-399: LGTM! Consider adding RTL support.The implementation follows the component's styling patterns and properly uses design tokens for color and spacing. The asterisk is appropriately implemented using a pseudo-element.
Consider adding RTL support by using
margin-inline-startinstead ofmargin-left:.bit-ctp-req { .bit-ctp-lbl::after { content: "*"; color: $clr-req; - margin-left: spacing(0.625); + margin-inline-start: spacing(0.625); } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.scss(1 hunks)src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/CircularTimePicker/BitCircularTimePickerDemo.razor(1 hunks)src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/CircularTimePicker/BitCircularTimePickerDemo.razor.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build and test
🔇 Additional comments (4)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor (1)
36-36: LGTM! The required attribute is correctly implemented.The
requiredattribute is properly bound to theRequiredproperty, which will enforce HTML5 validation when the property is true.src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor.cs (1)
282-282: LGTM! The CSS class registration is well implemented.The class registration correctly considers both
IsEnabledandRequiredstates, following the component's established patterns.src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/CircularTimePicker/BitCircularTimePickerDemo.razor (1)
22-22: LGTM! The Required property is demonstrated effectively.The example clearly shows how to use the new Required property.
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/CircularTimePicker/BitCircularTimePickerDemo.razor.cs (1)
560-566: LGTM! The form submission handling is improved.The addition of a delay provides better user feedback by showing the success message for 3 seconds before clearing it.
This closes #9890
Summary by CodeRabbit
New Features
Style