Class: SourceMonitor::FilterDropdownComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- SourceMonitor::FilterDropdownComponent
- Defined in:
- app/components/source_monitor/filter_dropdown_component.rb
Overview
Renders a labeled filter dropdown with auto-submit behavior. Used across sources, items, and logs index views to provide consistent filter select styling and behavior.
Constant Summary collapse
- SELECT_CLASSES =
"rounded-md border border-slate-200 bg-white px-2 py-2 text-sm " \ "text-slate-700 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"
- LABEL_CLASSES =
"block text-xs font-medium text-slate-500 mb-1"
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(label:, param_name:, options:, selected_value: nil, form: nil) ⇒ FilterDropdownComponent
constructor
A new instance of FilterDropdownComponent.
Constructor Details
#initialize(label:, param_name:, options:, selected_value: nil, form: nil) ⇒ FilterDropdownComponent
Returns a new instance of FilterDropdownComponent.
17 18 19 20 21 22 23 |
# File 'app/components/source_monitor/filter_dropdown_component.rb', line 17 def initialize(label:, param_name:, options:, selected_value: nil, form: nil) @label = label @param_name = param_name @options = @selected_value = selected_value.to_s @form = form end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 |
# File 'app/components/source_monitor/filter_dropdown_component.rb', line 25 def call content_tag(:div) do safe_join([ render_label, render_select ]) end end |