Class: Fluxbit::TimelineItemComponent
- Includes:
- Config::TimelineComponent
- Defined in:
- app/components/fluxbit/timeline_item_component.rb
Overview
The ‘Fluxbit::TimelineItemComponent` is a component for rendering individual timeline items.
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(**props) ⇒ Fluxbit::TimelineItemComponent
constructor
Initializes the TimelineItem component.
Methods inherited from Component
#add, #add_popover_or_tooltip, #anyicon, #element_name, #fx_id, #icon, #options, #popover?, #random_id, #remove_class, #remove_class_from_props, #render_popover_or_tooltip, #target, #tooltip?
Methods included from IconHelpers
#chevron_double_left, #chevron_double_right, #chevron_down, #chevron_left, #chevron_right, #chevron_up, #close_icon, #ellipsis_horizontal, #eye_icon, #eye_slash_icon, #plus_icon
Constructor Details
#initialize(**props) ⇒ Fluxbit::TimelineItemComponent
Initializes the TimelineItem component.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/components/fluxbit/timeline_item_component.rb', line 23 def initialize(**props) super @props = props @variant = @props.delete(:variant) || :default @title = @props.delete(:title) @description = @props.delete(:description) @date = @props.delete(:date) @icon = @props.delete(:icon) @status = @props.delete(:status), collection: styles[:item][:indicator][:status].keys, default: :default @color = @props.delete(:color), collection: styles[:item][:indicator][:colors].keys, default: :blue @ring = @props.delete(:ring), collection: styles[:item][:indicator][:rings].keys, default: :default @href = @props.delete(:href) if @variant != :stepper add class: styles[:item][:base], to: @props end remove_class_from_props(@props) end |
Instance Method Details
#before_render ⇒ Object
44 45 46 47 48 49 50 |
# File 'app/components/fluxbit/timeline_item_component.rb', line 44 def before_render super if @variant == :stepper # Add stepper classes after @is_last is set add class: styles[:stepper][:item], to: @props end end |