Class: ViewComponent::Storybook::Controls::OptionsConfig
- Inherits:
-
BaseOptionsConfig
- Object
- ControlConfig
- SimpleControlConfig
- BaseOptionsConfig
- ViewComponent::Storybook::Controls::OptionsConfig
- Defined in:
- lib/view_component/storybook/controls/options_config.rb
Constant Summary collapse
- TYPES =
%i[select radio inline-radio].freeze
Instance Attribute Summary
Attributes inherited from BaseOptionsConfig
Attributes inherited from SimpleControlConfig
Instance Method Summary collapse
Methods inherited from BaseOptionsConfig
Methods inherited from SimpleControlConfig
Methods inherited from ControlConfig
#description, #initialize, #name, #param, #prefix_param
Constructor Details
This class inherits a constructor from ViewComponent::Storybook::Controls::BaseOptionsConfig
Instance Method Details
#to_csf_params ⇒ Object
21 22 23 |
# File 'lib/view_component/storybook/controls/options_config.rb', line 21 def to_csf_params super.deep_merge(argTypes: { param => { options: } }) end |
#value_from_params(params) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/view_component/storybook/controls/options_config.rb', line 12 def value_from_params(params) params_value = super(params) if params_value.is_a?(String) && symbol_value params_value.to_sym else params_value end end |