Class: Daisy::DataDisplay::TextRotateComponent

Inherits:
LocoMotion::BaseComponent show all
Includes:
LocoMotion::Concerns::TippableComponent
Defined in:
app/components/daisy/data_display/text_rotate_component.rb

Defined Under Namespace

Classes: ItemComponent

Constant Summary

Constants inherited from LocoMotion::BaseComponent

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

Instance Attribute Summary collapse

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

Methods included from LocoMotion::Concerns::InspectableComponent

#build_inspect_string

Constructor Details

#initialize(texts: nil, **kws, &block) ⇒ TextRotateComponent

Creates a new Text Rotate component.

Parameters:

  • texts (Array<String>) (defaults to: nil)

    An optional array of strings for simple usage.

  • kws (Hash)

    The keyword arguments for the component.

Options Hash (**kws):

  • :wrapper_css (String)

    CSS classes to apply to the wrapper part that surrounds all of the rotated items.

  • :tip (String)

    The tooltip text to display when hovering over the component.



109
110
111
112
113
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 109

def initialize(texts: nil, **kws, &block)
  super(**kws, &block)

  @texts = texts
end

Instance Attribute Details

#textsObject (readonly)

Returns the value of attribute texts.



96
97
98
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 96

def texts
  @texts
end

Instance Method Details

#before_renderObject



115
116
117
118
119
120
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 115

def before_render
  super

  setup_component
  setup_texts if texts
end