Class: Plutonium::UI::Wizard::Stepper
- Inherits:
-
Component::Base
- Object
- Component::Base
- Plutonium::UI::Wizard::Stepper
- Defined in:
- lib/plutonium/ui/wizard/stepper.rb
Overview
The horizontal step indicator (§7). Renders the visible step path with a completed / current / upcoming state per step. Navigation mode gates which steps are clickable:
- :linear → only already-visited steps link back (no forward jumps).
- :free → any visited step links (still no forward jumps to unvisited).
Branch-hidden steps are simply absent from visible_path, so they never
appear here.
Instance Method Summary collapse
-
#initialize(steps:, current:, visited:, navigation:, step_url:, complete: []) ⇒ Stepper
constructor
A new instance of Stepper.
- #view_template ⇒ Object
Methods included from Component::Behaviour
Methods included from Component::Tokens
Methods included from Component::Kit
#BuildActionButton, #BuildActionsDropdown, #BuildAvatar, #BuildBlock, #BuildBreadcrumbs, #BuildBulkActionsToolbar, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildModalCentered, #BuildModalSlideover, #BuildPageHeader, #BuildPanel, #BuildRowActionsDropdown, #BuildSkeletonTable, #BuildTabList, #BuildTableFilterPills, #BuildTableInfo, #BuildTablePagination, #BuildTableScopesBar, #BuildTableScopesPills, #BuildTableSearchBar, #BuildTableToolbar, #BuildTableViewSwitcher, #method_missing, #respond_to_missing?
Constructor Details
#initialize(steps:, current:, visited:, navigation:, step_url:, complete: []) ⇒ Stepper
Returns a new instance of Stepper.
24 25 26 27 28 29 30 31 |
# File 'lib/plutonium/ui/wizard/stepper.rb', line 24 def initialize(steps:, current:, visited:, navigation:, step_url:, complete: []) @steps = steps @current = current @visited = visited.map(&:to_s) @complete = complete.map(&:to_s).to_set @navigation = @step_url = step_url end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Plutonium::UI::Component::Kit
Instance Method Details
#view_template ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/plutonium/ui/wizard/stepper.rb', line 33 def view_template nav(class: "pu-wizard-stepper mb-7", aria_label: "Progress") do ol(class: "pu-wizard-steps") do @steps.each_with_index do |step, index| render_step(step, index) end end end end |