Class: Primer::ProgressBarComponent
- Defined in:
- app/components/primer/progress_bar_component.rb
Overview
Use ‘ProgressBar` to visualize task completion.
Constant Summary collapse
- SIZE_DEFAULT =
:default- SIZE_MAPPINGS =
{ SIZE_DEFAULT => "", :small => "Progress--small", :large => "Progress--large" }.freeze
- SIZE_OPTIONS =
SIZE_MAPPINGS.keys
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(size: SIZE_DEFAULT, **system_arguments) ⇒ ProgressBarComponent
constructor
A new instance of ProgressBarComponent.
- #render? ⇒ Boolean
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(size: SIZE_DEFAULT, **system_arguments) ⇒ ProgressBarComponent
Returns a new instance of ProgressBarComponent.
56 57 58 59 60 61 62 63 64 |
# File 'app/components/primer/progress_bar_component.rb', line 56 def initialize(size: SIZE_DEFAULT, **system_arguments) @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:classes] = class_names( @system_arguments[:classes], "Progress", SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, SIZE_DEFAULT)] ) @system_arguments[:tag] = :span end |
Instance Method Details
#render? ⇒ Boolean
66 67 68 |
# File 'app/components/primer/progress_bar_component.rb', line 66 def render? items.any? end |