Class: Fluxbit::SpeedDialActionComponent
- Includes:
- Config::SpeedDialComponent
- Defined in:
- app/components/fluxbit/speed_dial_action_component.rb
Overview
The ‘Fluxbit::SpeedDialActionComponent` is a component for rendering individual action items in a Speed Dial.
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(**props) ⇒ Fluxbit::SpeedDialActionComponent
constructor
Initializes the SpeedDialAction 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::SpeedDialActionComponent
Initializes the SpeedDialAction component.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/components/fluxbit/speed_dial_action_component.rb', line 21 def initialize(**props) super(**props.slice(:tooltip_text, :tooltip_placement, :tooltip_trigger)) @props = props @icon = @props.delete(:icon) @text = @props.delete(:text) @tooltip = @props.delete(:tooltip) || @text @href = @props.delete(:href) @text_outside = @props.delete(:text_outside), default: false @square = @props.delete(:square), default: false @tooltip_placement = @props.delete(:tooltip_placement), default: :left @props[:id] ||= "speed-dial-action-#{random_id}" # Set tooltip via parent component if provided @tooltip_text = @tooltip if @tooltip.present? add class: [ styles[:action][:base], @square ? styles[:action][:shapes][:square] : styles[:action][:shapes][:rounded] ], to: @props @props[:type] ||= "button" unless @href remove_class_from_props(@props) end |
Instance Method Details
#before_render ⇒ Object
46 47 48 |
# File 'app/components/fluxbit/speed_dial_action_component.rb', line 46 def before_render add_popover_or_tooltip end |