Class: Daisy::DataInput::FieldsetComponent

Inherits:
LocoMotion::BaseComponent show all
Defined in:
app/components/daisy/data_input/fieldset_component.rb

Overview

Renders a fieldset element, optionally with a legend, to group related form controls or content.

Constant Summary

Constants inherited from LocoMotion::BaseComponent

LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS

Instance Attribute Summary

Attributes inherited from LocoMotion::BaseComponent

#config, #loco_parent

Instance Method Summary collapse

Methods inherited from LocoMotion::BaseComponent

build, #component_ref, #config_option, #cssify, define_modifier, define_modifiers, define_part, define_parts, define_size, define_sizes, #empty_part_content, #inspect, #part, register_component_initializer, register_component_setup, #rendered_css, #rendered_data, #rendered_html, #rendered_stimulus_controllers, #rendered_tag_name, renders_many, renders_one, set_component_name, #set_loco_parent, #strip_spaces

Constructor Details

#initialize(legend: nil, **kws) ⇒ FieldsetComponent

Returns a new instance of FieldsetComponent.

Parameters:

  • legend (String) (defaults to: nil)

    Optional simple text for the legend. Ignored if the ‘legend` slot is used.



33
34
35
36
37
# File 'app/components/daisy/data_input/fieldset_component.rb', line 33

def initialize(legend: nil, **kws)
  @simple_legend = legend

  super(**kws)
end

Instance Method Details

#before_renderObject



39
40
41
42
43
# File 'app/components/daisy/data_input/fieldset_component.rb', line 39

def before_render
  setup_component

  super
end