Class: Fluxbit::StepperComponent::Step

Inherits:
Component
  • Object
show all
Includes:
Config::StepperComponent
Defined in:
app/components/fluxbit/stepper_component.rb

Overview

Nested step component

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#add, #add_popover_or_tooltip, #anyicon, #element_name, #fx_id, #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::StepperComponent::Step

Initializes a step item for the stepper.

Parameters:

  • **props (Hash)

    The properties to customize the step.

  • props (Hash)

    a customizable set of options

Options Hash (**props):

  • :title (String)

    The title of the step.

  • :description (String)

    The description of the step.

  • :state (Symbol) — default: :pending

    The state of the step (:pending, :active, :completed).

  • :number (String, Integer)

    The step number or custom text.

  • :icon (String)

    The icon name to display for completed state.



206
207
208
209
210
211
212
213
214
215
216
217
# File 'app/components/fluxbit/stepper_component.rb', line 206

def initialize(**props)
  super
  @props = props

  @title = @props.delete(:title)
  @description = @props.delete(:description)
  @state = options @props.delete(:state), collection: [ :pending, :active, :completed ], default: :pending
  @number = @props.delete(:number)
  @icon = @props.delete(:icon)

  remove_class_from_props(@props)
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



193
194
195
# File 'app/components/fluxbit/stepper_component.rb', line 193

def description
  @description
end

#iconObject (readonly)

Returns the value of attribute icon.



193
194
195
# File 'app/components/fluxbit/stepper_component.rb', line 193

def icon
  @icon
end

#numberObject (readonly)

Returns the value of attribute number.



193
194
195
# File 'app/components/fluxbit/stepper_component.rb', line 193

def number
  @number
end

#stateObject (readonly)

Returns the value of attribute state.



193
194
195
# File 'app/components/fluxbit/stepper_component.rb', line 193

def state
  @state
end

#titleObject (readonly)

Returns the value of attribute title.



193
194
195
# File 'app/components/fluxbit/stepper_component.rb', line 193

def title
  @title
end

Instance Method Details

#callObject



219
220
221
# File 'app/components/fluxbit/stepper_component.rb', line 219

def call
  content
end