Class: ViewComponent::Storybook::Controls::Options

Inherits:
BaseOptions show all
Defined in:
lib/view_component/storybook/controls/options.rb

Constant Summary collapse

TYPES =
%i[select radio inline-radio].freeze

Instance Attribute Summary

Attributes inherited from BaseOptions

#labels, #options, #type

Attributes inherited from Control

#default, #description, #name, #param

Instance Method Summary collapse

Methods inherited from BaseOptions

#initialize

Methods inherited from SimpleControl

#initialize

Methods inherited from Control

#initialize

Constructor Details

This class inherits a constructor from ViewComponent::Storybook::Controls::BaseOptions

Instance Method Details

#parse_param_value(value) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/view_component/storybook/controls/options.rb', line 12

def parse_param_value(value)
  if value.is_a?(String) && symbol_value
    value.to_sym
  else
    value
  end
end

#to_csf_paramsObject



20
21
22
# File 'lib/view_component/storybook/controls/options.rb', line 20

def to_csf_params
  super.deep_merge(argTypes: { param => { options: options } })
end